LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Starting a vncserver instance automatically at startup (http://www.linuxquestions.org/questions/linux-general-1/starting-a-vncserver-instance-automatically-at-startup-131446/)

paul.nel 01-04-2004 01:32 PM

Starting a vncserver instance automatically at startup
 
I am having immense problems automating a simple scrip to start an instance of vncserver at when my machine starts up. Any clues of where to put the script file would be great.

Tx
p.n

TheOther1 01-04-2004 04:31 PM

On your RH (and I guess your SuSE also) you can set vncserver service to start by running serviceconf (in GUI) or chkconfig at CLI. Syntax for chkconfig is:

chkconfig --level 35 vncserver on

to start it in init3 and init5

HTH!

paul.nel 01-05-2004 11:39 AM

Well, this is actually not the problem. The service starts fine when the machine boots up. I need to start a VNC session eg ServerName:1 automatically. Any ideas on this would be helpful.

Thanks
p.n

ezra143 01-05-2004 06:20 PM

ok try same as above but

chkconfig --level 35 vncviewer host:1 on

paul.nel 01-08-2004 03:51 AM

Nope. This is not it. I am sure I should be able to run a simple start up script. I tried one from /etc/rc.d/script but obviously there is something fundamental that I do not yet understand.

regards
p.n

Marius2 01-08-2004 10:04 AM

Go to /etc/. (Hopefully) you'll find a folder rc.d and in it rc1.d-rc6.d. Just
put a script in the appropiate* folder, which contains something like
/wherever/it/is/stored/vncserver - don't forget to chmod +755 or whatever
it.
Name of the script can be derived from the other files in the folder, they're
usually something like S<twodigits><processname>, eg. S27vncserver.

Instead of a script you may also use a symlink, example
ln -snf /wherever/it/is/stored/vncserver /etc/rc.d/rc3.d/S27vncserver

BTW as which user did you install VNC? If you installed it as another
user than root, you'll probably run into the problem that the system will
try to execute the script/link in /etc/rc.d/... as root, but vncserver will
not find its config files in /root/.vnc.


*numbers refer to the runlevel. Not sure if the system goes through all
the folders, but if you enter >runlevel< at the console (after booting) and it comes back with 3, you should be fine with putting it into rc3.d.

benjithegreat98 01-08-2004 09:24 PM

you could also put in some script lines in /etc/rc.d/rc.local (for RH, anyways. don't know about suse). rc.local executes after all the other startup scripts execute. It is good for simple stuff.... like a one liner to start up a vnc instance.


All times are GMT -5. The time now is 05:29 PM.