About the Auto start program for Redhat Linux Server
YP
Oct 6, 2005
Auto start script
================================
- The start script of program is usually put under the folder: /etc/rc.d/init.d
- There are rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d and rc6.d six folder coressponding to six run level of Operating system.
- The are many links(?) under each rc?.d folder, which reperants what start script should run for this runlevel, each link point to a start scritp under init.d folder.
for example: Tomcat
- put tomcat's start (stop) script "catalina.sh" under folder: /etc/rc.d/init.d
- put a link point to the script "catalina.sh", the link name could be "s81tomcat", because the link for apach is s85httpd and Tomcat is supposed to start before Apache start for the 'Apache+Tomcat work together' reason.
root@LinuxServer etc]# ln -s /etc/rc.d/init.d/catalina.sh rc5.d/s81tomcat
- the script with a smaller number runs earlier than the script with a greater number.
service script
================================
- A file named xinetd.conf is under the folder /etc, usually a line like "includedir /etc/xinetd.d" is inside this file.
- Underneath the folder named "/etc/xinetd.d", there are many server files there for different server.
- For example, for cvs server, there is a file named "cvsserver" and with following content.
------------------------------
service cvspserver
{
port = 2401
socket_type = stream
protocol = tcp
wait = no
user = root
passenv = PATH
server = /usr/bin/cvs
env = HOME=/home/cvsroot
server_args = -f --allow-root=/home/cvsroot pserver
}
-----------------------------------------------------------