views:

187

answers:

3

/etc/init.d/*

/etc/rc{1-5}.d/*

+2  A: 

/sbin/chkconfig — The /sbin/chkconfig utility is a simple command line tool for maintaining the /etc/rc.d/init.d/ directory hierarchy.

px
A: 

in one word: init.

This process always has pid of 1 and controls (spawns) all other processes in your unix according to the rules in /etc/init.d.

init is usually called with a number as an argument, e.g. init 3 This will make it run the contents of the rc3.d folder.

For more information: Wikipedia article for init.

Edit: Forgot to mention, what actually controls what rc level you start off in is your bootloader.

dsm
+1  A: 

As mentioned by px, the proper way to manage the links to scripts from /etc/init.d to /etc/rc?.d is the /sbin/chkconfig command.

Scripts should have comments near the top that specify how chkconfig is to handle them. For example, /etc/init.d/httpd:

# chkconfig: - 85 15
# description: Apache is a World Wide Web server.  It is used to serve \
#          HTML files and CGI.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd.pid

Also, use the /sbin/service command to start and stop services when run from the shell.

jtimberman