Starting a Service (vncserver) at boot

Craig White plug-discuss@lists.plug.phoenix.az.us
17 Feb 2003 20:18:04 -0700


On Mon, 2003-02-17 at 16:57, George Gambill wrote:
> RedHat 8.0
> 
>  can start the service from the command line but I need to start it at boot
> time before anyone logs in.
> 
> There must be a file somewhere (like a .conf) that will allow me to add the
> commands required.  As usual, if I am going strange here (as in "don't do
> this in the real world"), please let me know.  However, at the moment, this
> is for demonstration (not real world) purposes only.
> ---------------------------------------------------
chkconfig --levels 2345 vncserver on

that will cause it to automatically start vncserver at startup.

chkconfig vncserver start (will start it now)

You might want to take note of some other info...

My /etc/sysconfig/vncservers looks like this...
(note the modifications)
VNCSERVERS="1:craig 2:root 3:jennifer 4:larry"
ARGS="-geometry 1280x1024 -depth 16 -alwaysshared "

and thus, I have modified /etc/init.d/vncserver...

find the line...
             "su ${display##*:} -c \"cd ~${display##*:} && [ -f
.vnc/passwd ] && vncserver :${display%%:*}\""

and change it to...
             "su ${display##*:} -c \"cd ~${display##*:} && [ -f
.vnc/passwd ] && vncserver :${display%%:*} $ARGS\""

Hopefully, you'll get the idea.

I found it worthless to try to use KDE to log in via VNC and locally, so
if that is your intention, use a different system (Gnome or something
else).

Craig