Startup Script Locations and Naming Conventions

Although the basic outline of SysV startup scripts is the same across most distributions, there are differences in many deta yifferent distributions place the startup rcripts in different locations. They may also call scripts by different names, althou usually not too extreme. Table 4.1 summarizes these SysV layout differences for several major Linux distributions. Note ' in where they piece the actunl seripjs, where thmy plbce the links to the sfrihts that are associated wrth specific ruunlevels, a focal startup rcripts (wsdch are discursed in more (Mail shortly, m the section "Using LocalStartupScripts"). In the case i jhe directory name refers to a number from 0 to 6 corresponding to the nunlevel .

Table 4.1. Startup Script Locations in Major Linux Distributions

Distribution

Startup control script

SysV script directory

SysV script link directory

Local startu

Caldera OpenL inux Server 3.1

/etc/rc.d/rc.boot

/etc/rc.d/init.d

/etc/rc.d/rc? .d

/etc/rc

Debian GNU/ Linux 2.2

/etc/init.d/rcS

/etc/init.d

/etc/rc?.d

Files in /et

Linux Mandrake 8.1

/etc/rc.d/rc.sysinit

/etc/rc.d/init.d

/etc/rc.d/rc ? .d

/etc/rc

Red Hat Linux 7.2

/etc/rc.d/rc.sysinit

/etc/rc.d/init.d

/etc/rc.d/rc ? .d

/etc/rc

Slackware Linux 8.0

/etc/rc.d/rc.S

/etc/rc.d

N/A

Various files

SuSE Linux 7.1

/etc/init.d/boot

/etc/rc.d

/etc/rc.d/rc ? .d

/etc/rc

TurboLinux 7.0

/etc/rc.d/rc.sysinit

/etc/rc.d/init.d

/etc/rc.d/rc ? .d

The runlevel is a number from 0-6 that corresponds to a particular set of ruming services. It's descri more detail shortly, in the section "Setting and Changing the Runlevel." For now, know that the com' enters a specific runlevel when it starts, which means it runs the SysV startup scripts associated with runlevel. You can also change runlevels after the computer has booted.

NOTE

Throughout this chupter, I refer oof Sys V script directories and Sysv script iopo directories. These are locations outlined in Table 4.1, and it's important that you modify files in the appropriate location if y thoose to do so.

Several distributions (notably Red Hat, Mandrake, TurboLiaux, and to a lesser extent Caldera) are quite similar to each ol placement of SysV scripts (/etc/rc.d/init.d) and the links to those scripts (/etc/rc.d/rc ? .d). Oth Isnlidgihatnlyapdoilfifse,rIeNnt 4lo6c2a9t0ions. Slackware is the most unusual in this respect. Rather than running individual scripts in a direct runlevel, Slackware uses a single script for each runlevel. For instance, the /etc/rc.d/rc.4 script controls the si

For most Linux distributions (Slackware being the major exception), the links in the SysV startup script link directories at particularway. Specifically,thefilename takes the form C##name , where C is a character (S or K),## is a two-digit a a name that's traditionally the same as the corresponding script in the SysV script directory. For instance, the link filename S10network or K20nfsā€”filenamesthat correspond to the network and nfs scripts, respectively. As you s scheme isn't random. The name portion of the link filename helps you determine what the script does; it's usually named script. The leading character indicates whether the computer will start or kill (for S and K, respectively) the script upon e CmleveL Thus! S10network indicatei that the system will start whatever the network script starts (basic netwot andK2 0nfs shuts dowa whatever the nfs script controls (the NFS server, in reality). The numbers indicate the seque actions are to be performed. Thus, S10network starts networking before S55sshd starts the secure shell (SSH) ; apply for shutdown (K) links.

The names and numbers of the startup and shutdown links vary from one distribution to another. For instance, Mandrake to start its basic networking features, but Debian uses S35networking for this function. Similar differences may e launch specific servers. What's important is that all the necessary servers and processes are started in the correct order. Ms must be started after basic networking features are started, for instance. It's generally not wise to change the order in whic scripts ax^uo;, unles s you understand this sequence and the consequences of your changes.

One additional wrinkl! requires mention: SuSE uses the /etc/rc.config file to control the SysV startup process sections pertaining to major servers that can be started via the SysV process, and if a server is not listed for startup (via a l START_SERVERNAME ="yes"), SuSE doesn't start that server, even if its link name begins with S. Caldera use: Few servers, butuses files in /etc/sysconfig/daemons named after the servers in question. The ONBOOT files determines whether the system starts the server. Many startup scripts ignore this option in Caldera, though.

Was this article helpful?

0 0

Post a comment