You could use chkconfig (on RH)...

1) add a commented first line to the /etc/init.d/vncd (or boot.vnc) script

   # chkconfig: 345 80 20

2) then issue the following command (as root)

   #> chkconfig vncd on

Voila!
Frank.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Valis Keogh
Sent: Thursday, 29 July 2004 7:29 AM
To: [EMAIL PROTECTED]
Subject: RE: Linux Start UP Scripts


thanks again for the reminder of why i dont use linux for a desktop
machine...

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Zach Dennis
Sent: Wednesday, July 28, 2004 1:39 PM
To: Omelin Morelos; [EMAIL PROTECTED]
Subject: RE: Linux Start UP Scripts


Ok this is lengthy. I dont' know how savvy you are on the command line so
bare with me.

There are 7 folders (which are typically found in the /etc directory, if
they are not there search the /etc directory because they may be i another
subdirectory of /etc):
- rc0.d
- rc1.d
- rc2.d
- rc3.d
- rc4.d
- rc5.d
- rc6.d

These correspond to the different run levels that Linux has.
- Runlevel 0 is when you turn your computer off.
- Runlevel 1 is single user mode
- Runlevel 2 is multi user mode w/o NFS
- Runlevel 3 is multi user mode w/NFS
- Runlevel 4 is reserved for different vendors to define
- Runlevel 5 is GUI mode.
- Runlevel 6 is when you reboot your computer.

If you look into the rc0.d you'll see a bunch of scripts (or symlinks to
scripts). They either start with a "K" or an "S". When your Linux system
starts into a Runlevel it looks inside of it's corresponding rcX.d folder.
Scripts that start with a "K" are stopped or killed. Scripts that start with
an "S" are started. You'll also notice that after the "S" or the "K" is a
number. When scripts are started it will start "S1script" before
"S99script". The reverse goes for "K1script" and "K99script" (this is killed
first)

If you would like start a script at boot, you need to make a script. For VNC
you can just as easily use a bash script. Copy the following into a file
named "boot.vnc" and place this in the /etc/init.d folder.

---START SCRIPT
/usr/bin/vncserver :1 -geometry 1024x768 &> /dev/null &
##Uncomment the next line to make it run for various users
#su - username -c "/usr/bin/vncserver :2 -geometry 1024x768 &> /dev/null &"
---END SCRIPT

No go into each of the corresponding runlevel folders (rcX.d) of when you
want to start your script. This is normally runlevel 2,3 and 5. So go in
/etc/rc2.d, /etc/rc3.d and /etc/rc5.d. Do an "ls" and look to see what
numbers are available. typically 80 is available. Make a symlink:

ln -s /etc/init.d/boot.vnc /etc/rc2.d/S80boot.vnc
ln -s /etc/init.d/boot.vnc /etc/rc3.d/S80boot.vnc
ln -s /etc/init.d/boot.vnc /etc/rc5.d/S80boot.vnc

Now your vnc will start when you enter runlevel 2,3 and 5. But we still need
to kill it when you turn the computer off or reboot. And we should also kill
it in the runlevels we dont' want to use it in.

ln -s /etc/init.d/boot.vnc /etc/rc0.d/K80boot.vnc
ln -s /etc/init.d/boot.vnc /etc/rc1.d/K80boot.vnc
ln -s /etc/init.d/boot.vnc /etc/rc4.d/K80boot.vnc
ln -s /etc/init.d/boot.vnc /etc/rc6.d/K80boot.vnc

Now reboot your computer. All should be well.

Please don't take everything in this post word for word verbatim for "YOUR"
system. Your system may differ from mine. You may have to look in a
different spot for the rcX.d directories.

I hope this helps all of those wondering about this.

Zach Dennis









---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.725 / Virus Database: 480 - Release Date: 7/19/2004
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list

Reply via email to