forrige foredrag

Reordering the Debian boot sequence for correctness and speed

Autodetecting and configuring hardware during installation and at runtime

Petter Reinholdtsen
pere@hungry.com
FOSDEM 2008, 2008-02-26

Summary

SysV init in Debian - Booting

Note, this is the stuff going on after the initrd part is done. The very early boot is done before hard drive partitions is mounted.

  1. /sbin/init start, which look at /etc/inittab and decides what to do.
  2. The scripts in /etc/rcS.d/ is executed in sequence by /etc/init.d/rc, with start as the argument.
  3. Depending on the runlevel, the scripts for the given runlevel is executed (normally the ones in /etc/rc2.d/) are executed in sequence, first the stop scripts with stop as their argument, next the start scripts with start as their argument. The rc*.d/ directories contain symlinks the files in to /etc/init.d/.
  4. The ordering is important.
  5. The single-user runlevel will present a login prompt after rcS.d/ was executed. Runlevel 1 is not the single user runlevel, but it behaves as a better single user.

SysV init in Debian - Switching runlevels

Note that switching to runlevel S will not run the scripts in /etc/rcS.d/. To get a similar effect after boot, switch to runlevel 1. It will (should) kill all services and prepare the machine for maintenance.

SysV init in Debian - Shutting down

This is equivalent to switching to runlevel 0 (halt) or 6 (reboot), with a minor exception. All scripts (both start and stop) are executed with the stop argument.

about ordering

Script ordering is vital for this to work. And how are the scripts ordered? update-rc.d numbers.

LSB headers for insserv

What to list as dependencies I

If your package used the default update-rc.d settings before, this is the header for you:

### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

$remote_fs is needed by all scripts using files in /usr/. $syslog is needed only by scripts starting services logging to syslog.

Status of dependency based boot

LSB header progress graph

Release goal for Debian Lenny.

Packages with LSB header: 654 of 866 (76%)
Unsolved BTS reports: XXX
Packages without BTS reports: ~150

Need better documentation

Need debian policy updates

- status in debian - need better doc - fix insserv bugs

Thank you very much

Questions?

http://www.hungry.com/~pere/mypapers/200802-bootsequence/200802-bootsequence.html