3.18) What happened to /etc/rc and /etc/rc.local?

They're now fragmented into 12 million tiny little pieces. Look in the following files to get oriented:

	    /etc/inittab - defines which programs init starts and when.
	    /sbin/rcS, /etc/rcS.d/* - booting stuff
	    /sbin/rc2, /etc/rc2.d/*,
		    /sbin/rc3, /etc/rc3.d/* - stuff for multi-user startup.
Note that all files in /etc/rc*.d/* are hardlinked from /etc/init.d (with better names), so you should grep in there.

There are many "run levels" to the System V init; the run level 3 is normally used for "multi user with networking."

When executing the scripts in an /etc/rc?.d directory, the K* scripts are executed first, followed by the S* scripts. Scripts ending in .sh are executed in the same shell and can be used to set environment variables used further on in the same directory.

A basic startup script looks like this:

#!/bin/sh
# Sample init.d script.
# Install a copy under /etc/init.d/your-daemon
# make links to /etc/rc2.d/Sxxyour-daemon (or rc3.d)
# and /etc/rc[01].d/Kxxyour-daemon.
# Scripts ending in .sh are executed with the sh "." command.
# Scripts not ending in .sh are executed as "sh script"

case "$1" in start) #... commands to start daemon .... ;; stop) #... commands to stop daemon .... ;; esac

PREV INDEX NEXT