(Answer) (Category) VNC FAQ-o-Matic : (Category) Special setup tricks for VNC on Linux/Unix :
How can I get VNC to start automatically at boot time?
(this example is taken from a Solaris environment)

Here's how to setup the usual startup/stop script approach used by other
Solaris programs to get VNC to start at boot time.

First become root.  Then create a file called /etc/init.d/rc.vnc with the
following content (modified appropriately, see below):

---------------start file on next line--------------------
#!/bin/sh
#
# Startup/Stop script for vncservers for some users.
#

case "$1" in

'start')
   /bin/su - bob -c "/usr/local/bin/vncserver :1"
   /bin/su - sally -c "/usr/local/bin/vncserver :2"
   /bin/su - jim -c "/usr/local/bin/vncserver :3"
   ;;

'stop')
   /bin/su - bob -c "/usr/local/bin/vncserver -kill :1"
   /bin/su - sally -c "/usr/local/bin/vncserver -kill :2"
   /bin/su - jim -c "/usr/local/bin/vncserver -kill :3"
   ;;

*)
   echo "Usage: /etc/init.d/rc.vnc { start | stop }"
   ;;

esac
---------------end file on previous line--------------------

The names bob, sally and jim are usernames.  Modify accordingly.  The
corresponding numbers :1, :2, :3 for VNC may also need to be changed.

Make sure that /etc/init.d/rc.vnc has the correct ownership/permissions:

# chown root:other /etc/init.d/rc.vnc
# chmod 744 /etc/init.d/rc.vnc

Next create symbolic links to that file as follows:

# cd /etc/rc0.d
# ln -s ../init.d/rc.vnc K40rc.vnc
# cd /etc/rc2.d
# ln -s ../init.d/rc.vnc S99rc.vnc

That should do it.  I've been doing it this way for years and it works
great for me.  I'd rather not add things to inetd.conf when I don't have
to.

Thanks to Mike Miller for the Contribution!
Subcategories:

Answers in this category:

[Append to This Answer]
Previous: (Answer) How to setup VNC to work with Inetd on *nix
Next: (Answer) Another approach to getting VNC to start at Boot
This document is: http://faq.gotomyvnc.com/cgi-bin/fom?file=67
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by sbest@best.com