Reordering the boot sequence for correctness and speed
There are several boot options available in Debian, and the default SysV-derived one can be tuned and corrected. The talk will present the available options, and go into details on some of the pitfalls and advantages of the default boot system. It will present some results based on the Google summer of code project working on the boot system.
Based on work done by Carlos Villegas during Google Summer of Code 2006, available from http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/.
SysV init is only the most used boot system in Debian, not the only one.
/etc/rcS.d: README S30checkfs.sh S01glibc.sh S30procps.sh S02hostname.sh S35mountall.sh S02mountkernfs.sh S36mountall-bootclean.sh S04mountdevsubfs.sh S39ifupdown S05bootlogd S40networking S10checkroot.sh S45mountnfs.sh S11hwclock.sh S46mountnfs-bootclean.sh S12mtab.sh S55bootmisc.sh S18ifupdown-clean S55urandom S20module-init-tools S99stop-bootlogd-single S25libdevmapper1.02.1 /etc/rc2.d: README S89cron S10sysklogd S99rc.local S11klogd S99rmnologin S20makedev S99stop-bootlogd S20openbsd-inetd
/etc/rc6.d: K11cron S30urandom K20makedev S31umountnfs.sh K20openbsd-inetd S35networking K25hwclock.sh S36ifupdown K89klogd S40umountfs K90sysklogd S60umountroot README S90reboot S20sendsigs
But is it correct?
Example header:
#!/bin/sh -e ### BEGIN INIT INFO # Provides: networking # Required-Start: mountkernfs ifupdown $local_fs # Required-Stop: ifupdown $local_fs # X-Start-Before: nis # X-Stop-After: nis # Default-Start: S # Default-Stop: 0 6 # Short-Description: Raise network interfaces. ### END INIT INFO
Using these headers and a script from the insserv package, we can verify the boot order:
# /usr/share/insserv/check-initd-order -o LSB header missing in /etc/rcS.d/S11hwclock.sh LSB header missing in /etc/rcS.d/S25libdevmapper1.02.1 Incorrect order modutils@? > checkfs.sh@30 Incorrect order $all@? > stop-bootlogd-single@99 Incorrect order $time@? > sysklogd@10 Incorrect order $time@? > cron@89 Incorrect order $all@? > rmnologin@99 #
For the packages without dependency information, override files can be read from /usr/share/insserv/overrides/ and /etc/insserv/overrides/.
Current status (base task install), with override files.
# /usr/share/insserv/check-initd-order Incorrect order $local_fs@? > hwclock.sh@11 Incorrect order $remote_fs@? > hwclock.sh@11 Incorrect order modutils@? > libdevmapper1.02.1@25 Incorrect order modutils@? > checkfs.sh@30 Incorrect order $all@? > stop-bootlogd-single@99 Incorrect order $all@? > rmnologin@99 #
Current status (desktop task install)
# /usr/share/insserv/check-initd-order -o LSB header missing in /etc/rcS.d/S11hwclock.sh LSB header missing in /etc/rcS.d/S25libdevmapper1.02.1 Incorrect order modutils@? > checkfs.sh@30 Incorrect order $all@? > stop-bootlogd-single@99 Incorrect order $time@? > sysklogd@10 LSB header missing in /etc/rc2.d/S19hplip LSB header missing in /etc/rc2.d/S20cupsys LSB header missing in /etc/rc2.d/S20hotkey-setup LSB header missing in /etc/rc2.d/S89anacron Incorrect order $time@? > cron@89 Incorrect order $all@? > rmnologin@99 #
Advantages:
How to enable this by default
To enable: BAD_INSSERV_HACKER=true dpkg-reconfigure insserv
Testrun:
insserv:/var/tmp/chroot-sid-base-reorder# BAD_INSSERV_HACKER=true dpkg-reconfigure i info: Backing up existing boot scripts in /var/lib/insserv/bootscripts-20070615T1617.tar.gz info: Reordering boot system, log to /var/lib/insserv/run-20070615T1617.log info: Recording new boot sequence in /var/lib/insserv/bootscripts-20070615T1617-after.list info: Use '/usr/sbin/update-bootsystem-insserv restore' to restore the old boot sequence. success: Boot system successfully converted Adding `diversion of /usr/sbin/update-rc.d to /usr/sbin/update-rc.d.distrib by insserv' #
/etc/rcS.d: README S05mtab.sh S01glibc.sh S06mountall.sh S01libdevmapper1.02.1 S07ifupdown S02hostname.sh S07mountall-bootclean.sh S02mountkernfs.sh S07urandom S03mountdevsubfs.sh S08networking S03procps.sh S09mountnfs.sh S04bootlogd S10mountnfs-bootclean.sh S04checkroot.sh S11bootmisc.sh S05checkfs.sh S11hwclock.sh S05ifupdown-clean S11stop-bootlogd-single S05module-init-tools /etc/rc2.d: README S11openbsd-inetd S07makedev S11rc.local S07sysklogd S12stop-bootlogd S08cron S13rmnologin S08klogd
/etc/rc6.d: K03openbsd-inetd K31umountnfs.sh K06cron K35networking K06klogd K36ifupdown K07sysklogd K40umountfs K20makedev K60umountroot K20sendsigs K90reboot K25hwclock.sh README
It is possible to automatically undo the reordering, once, by reconfiguring insserv and disabling the dependency based boot.
# BAD_INSSERV_HACKER=true dpkg-reconfigure i info: Disabling dependency based boot system Removing `diversion of /usr/sbin/update-rc.d to /usr/sbin/update-rc.d.distrib by insserv' info: Restoring using backed up copy of init.d/ and rc*.d/. info: successfully restored backup of init.d scripts #
echo CONCURRENCY=shell >> /etc/default/rcS