PDA

View Full Version : Run vncserver during boot



HeikoSchlicht
02-Jul-2014, 13:15
Hi there,

If I reboot the server SLES 11SP3 I like to have a auto run on
vncserver :2. I found 2 ways to solve the problem:

1)


#/etc/init.d/my_mainenance.sh
vncserver :2 geometry 1440x900



sudo /sbin/insserv my_maintenance.sh
root's password:
insserv:warning: script 'my_maintenance.sh' missing LSB tags
insserv: Default-Start undefined, assuming default start runlevel(s) for script 'my_maintenance.sh'


2)
create an entry in the personal crontab (not root's crontab). The line for the cron job is like this:

@reboot sleep 15; vncserver :2 -geometry 1440x900

which way I should prefer?

jmozdzen
03-Jul-2014, 13:39
Hi Heiko,

Hi there,

If I reboot the server SLES 11SP3 I like to have a auto run on
vncserver :2. I found 2 ways to solve the problem:

1)


#/etc/init.d/my_mainenance.sh
vncserver :2 geometry 1440x900



sudo /sbin/insserv my_maintenance.sh
root's password:
insserv:warning: script 'my_maintenance.sh' missing LSB tags
insserv: Default-Start undefined, assuming default start runlevel(s) for script 'my_maintenance.sh'


2)
create an entry in the personal crontab (not root's crontab). The line for the cron job is like this:

@reboot sleep 15; vncserver :2 -geometry 1440x900

which way I should prefer?

while I do like the idea of creating rc scripts, yours doesn't conform to the standards at all (thus the warnings on "insserv" and that together with a good chance that the script is called at the wrong moment, within the boot chain). So my suggestion would be to pimp that script to at least include the proper LSB headers and to handle parameter $1 (at least "start", "stop", "status").

If you want to keep it as short as you started, how about adding that line to "/etc/init.d/after.local"? From the master script "/etc/init.d/rc":

#
# Start the user defined resource control script which
# should be executed _after_ runlevel is reached.
#
if test -f /etc/init.d/after.local ; then
echo -n "Master Resource Control: "
echo "Running /etc/init.d/after.local"
/bin/sh /etc/init.d/after.local
rc_status -v1 -r
splashtrigger "after.local"
fi

Regards,
Jens

silviumc
16-Jul-2014, 12:19
Do you know this exists?

YaST2/Network Services/Remote Administration (VNC)

Or do you want something different?