hi,
i had this problem a couple of months ago, basically you need to add it to your start up, or init scripts as they are some times called
to do this:
find out what run level your computer starts in
you can do this by entering the command:
cat /etc/inittab |grep default
it will then return a few lines the last one it returns should be something like id:X:initdefault
the X represents a number, this number is the runlevel that your computer start in
next:
jump into the initscripts directory for that run level
todo this type :
cd /etc/rcX.d
( where X is the default run level )
in this directory are the 'init scripts' that the system runs at startup they generally named in this fashion
S**program ( where ** is the number order in which it is loaded ( 0 is first then 1 etc ) ) S means start and K means kill ( or to stop the process )
then use vi or your favorite text editing program to create the start up script
for example: vi S94vncserver
now you need to start creating your shell script
to start the file, on the very first line you need the shebang, this shebang is a hint to the system of what program is needed to process the script. a shebang line looks like this:
#!/bin/sh
the #! is the start of the shebang and sets the ball rolling, the '/bin/sh' gives refrence to sh, a command interpriter that most linux boxes have.
now you need to put your script together you can use normal command line options in this file ( as far as i know )
for example:
Code:
#!/bin/sh
#
# Description: Starts Vnc server at startup
echo "Starting VNCServer:"
/path/to/vnc/server && echo "Success"
the above is just basic script, its probably best if you look up using google 'linux shell scripts' and learning it properly. Plus look at some of your existing startup scripts and you will learn how to do one where you can type vncserver start or vncserver stop
dont forget to set the exeecute permission on the file you create or you may have problems
i would recomend starting vncserver last this gives the system the chance to load any program dependancys, like vnc needs network to be started first in order to function
i hope this helps
note: if there is any one else out there at can do this in a better way i really would like to hear it
please