Debian dependency based boot squence: insserv

Squeeze introduced the new dependency based boot sequence. Now, the insserv command is used instead of the well known update-rc.d, if dependency-based booting is enabled.

To make the new system work all startup scripts have to follow the guidelines. The /etc/init.d/apache2 header e.g. looks like this:

#!/bin/sh
### BEGIN INIT INFO
# Provides:          apache2
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start/stop apache2 web server
### END INIT INFO

[...]

To enable the apache startup script and be verbose:

insserv -v apache

Without -v there will be no output at all if no error occurs.

If you want to verify manually if all the required links have been created run:

find /etc/rc?.d -name '*apache*'
rc0.d/K01apache
rc1.d/K01apache
rc2.d/S03apache
rc3.d/S03apache
rc4.d/S03apache
rc5.d/S03apache
rc6.d/K01apache

Another way to check what's configured would be to inspect the following tree files in /etc/init.d:

.depend.boot
.depend.stop
.depend.stop
grep -H apache /etc/init.d/.depend.* | less

To remove a service from all runlevels run:

insserv -rv apache

To restore ALL runlevels as defined in the scripts run:

insserv -dv
debian/insserv.txt · Last modified: 2013-11 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready