fbpx Dependency-based boot sequence of Debian OS, Debian Server, Debian Dedicated Server | HostingUltraso.com
24/7/365 Support

Dependency-based boot sequence of Debian OS

As mentioned previously, this is now the default as of Debian 7 Wheezy. Itwas introduced in Debian 6 Squeeze, although it could be turned off. It is now always enabled, although provisions are made for legacy ordering (assigning specific numbers to start and stop scripts). Because of this, the administrator no longer needs to determine the order in which the init scripts are run. This is now handled by the insserv utility.

The insservutility should not be called clirectly. The update-reo d

utility provided by Debian, which calls the low-level insserv command,

is the recommended interface to manage init scripts.

The init scripts must now have dependencies and defaults listed in a special set of headers, along with a description of the script, what service or services itprovides, and what run levels the service should be active in. A good example is the beginning of the script for starting Apache:

lIl/bin/sb lIlili BBGIN INIT INFO

i Provides: apacha.2

i Required-Start: $local_fa $remota_fa $network $Byslog $named II Required-Stop: $local_fB $remote_fa $network $Byslog $named i Default-Start: 2 3 4 5 II Default-Stop: o 1 6

i X-Interactive: true i Short-Description: Start/stop apache2 web server

lIliji BND INIT INFO

The fields are fairly self-explanatory. 1ms script provides the apache2 service. Other scripts can name this service as a pre-requisite. 1his script requires that local and remote filesystems be mounted, and that the network be up, and that syslog and named services be available prior to starting. likewise, these services must not be stopped after this script has shut down the apache2 service. The default runlevels where apache2 should be active are 2 through 5, and of course, 0, 1, and 6 is where it is stopped. The X-Interactive field means that the script can require user input if it is run in such a way that a terminal is available to communicate with the script. There are other fields available as well, which are documented in the insserv manual page.

• These headers are called LSB headers, since they are defined in the

Linux Standard Base document, developed jointly by a number of Linux distributions under the organizational structure of the Linux Foundation

While dependencies generally do not change, the administrator can modify what run levels a script is active in. 1ms should not be done by editing the headers. Rather, update-re. d should be used to modify the run levels. For example, suppose you want apache to run only in run levels 4 and 5, and not 2 or 3, the command updatere. d apaehe2 disable 2 3 will do this.

Many scripts provide a switch in their fete/default configfile that

defines whether the service should run at all. When you want to disable a

service completely, this switch should be used in preference to disabling

the script in all run levels via update-re. d.

The manual page for update-re. d also documents the options start and stop, as well as a means of specifying the start or stop order of a script (using the legacy method of assigning numbers to the start and stop links). However, these are deprecated and it appears they will be removed in Jessie (Debian 8).

H you have locally developed or third-party init scripts that do not .ct include the necessary headers, Debian 7 will still boot using the old method of script ordering, but will notify you of the reasons it can't

migrate to a dependency-based boot sequence.

Help Category:

What Our Clients Say