Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
however either the vncserver service does not start, or no X11 sessions are started from the /usr/bin/vncserver script.
The problem is that should I enter these same commands at the command line or execute the rc.local file after the system has booted, everything works fine!
Moreover running an nmap after starting vnc also starts a service named vnc-http-1 at port 5801. I can only connect to port 5901 which the vnc-1 service listens to. What is the use of the vnc-http-1 service?
The http port is used to load the java viewer via a web browser.
Try creating a logfile for those commands to see if it gives you more information - change the commands to:
/etc/init.d/vncserver start 2>&1 > /tmp.vncserver1.log
/usr/bin/vncserver :1 -geometry 1280x1024 2>&1 > /tmp.vncserver2.log
/usr/bin/vncserver :2 -geometry 800x600 2>&1 > /tmp.vncserver3.log
only log 1 has a 50 byte size after a reboot. here's what I get:
[root@gdgate /]# cat ./tmp.vncserver1.log
Starting VNC server: [ OK ]
now explain that:
Code:
[root@gdgate /]# nmap localhost
Starting nmap 3.48 ( http://www.insecure.org/nmap/ ) at 2004-01-15 22:21 EET
Interesting ports on gdgate.pwn (127.0.0.1):
(The 1653 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
631/tcp open ipp
Nmap run completed -- 1 IP address (1 host up) scanned in 2.734 seconds
[root@gdgate /]# /etc/init.d/vncserver status
Xvnc is stopped
[root@gdgate /]# /etc/rc.local
SIOCADDRT: File exists
New 'gdgate.pwn:1 (root)' desktop is gdgate.pwn:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/gdgate.pwn:1.log
New 'gdgate.pwn:2 (root)' desktop is gdgate.pwn:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/gdgate.pwn:2.log
[root@gdgate /]# /etc/init.d/vncserver status
Xvnc (pid 2028 2017) is running...
[root@gdgate /]# nmap localhost
Starting nmap 3.48 ( http://www.insecure.org/nmap/ ) at 2004-01-15 22:22 EET
Interesting ports on gdgate.pwn (127.0.0.1):
(The 1647 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
631/tcp open ipp
5801/tcp open vnc-http-1
5802/tcp open vnc-http-2
5901/tcp open vnc-1
5902/tcp open vnc-2
6001/tcp open X11:1
6002/tcp open X11:2
Nmap run completed -- 1 IP address (1 host up) scanned in 3.283 seconds
[root@gdgate /]#
What about adding a few pauses:
sleep 30
/etc/init.d/vncserver start
sleep 30
/usr/bin/vncserver :1 -geometry 1280x1024
sleep 30
/usr/bin/vncserver :2 -geometry 800x600
This will put 30 second pauses to let the previous command run for a while. Try it with the long pauses just for testing purposes although it will slow your boot down by 1 1/2 minutes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.