From: Petter Reinholdtsen
Date: Sat, 23 Feb 2008 09:26:13 +0000 (+0000)
Subject: Update to current version.
X-Git-Url: https://pere.pagekite.me/gitweb/homepage.git/commitdiff_plain/45f7f5e186d8a1bcc88fe9f9794d3aa3333c83ab?ds=inline
Update to current version.
---
diff --git a/mypapers/200802-bootsequence/200802-bootsequence.html b/mypapers/200802-bootsequence/200802-bootsequence.html
index 21e9e045bf..bdd8957556 100644
--- a/mypapers/200802-bootsequence/200802-bootsequence.html
+++ b/mypapers/200802-bootsequence/200802-bootsequence.html
@@ -6,6 +6,11 @@
+
@@ -55,7 +60,11 @@ This talk is about how all of this can be done with Debian.
- how does it work in debian
- effect on the boot
- insserv
+ - how to verify the boot sequence
+ - check script
+ - dependency graph using dotty
- how to test it
+ - overriding included headers
- speed change?
- concurrency
@@ -104,6 +113,9 @@ The very early boot is done before hard drive partitions is mounted.
+Note that because the Linux kernel is becoming more and more event
+based, the boot sequence is no longer sequencial.
+
SysV init in Debian - Switching runlevels
@@ -127,9 +139,15 @@ 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.
+
This is roughtly equivalent to switching to runlevel 0 (halt) or 6
+(reboot).
+
+Minor exception: all scripts (both start and stop) are executed
+ with the stop argument, ignoring their start and stop
+ setting and confusing script writers.
+
+Only stop scripts for services started in the previous runlevel is
+ executed.
The ordering problem
@@ -184,7 +202,73 @@ numbers using this dependency information. Example:
sequencing, provided in the insserv package. Uses format specified in
Linux Software Base to document dependencies.
+Checking the current boot sequence
+
+Static checking of current headers:
+/usr/share/insserv/check-initd-order [-o] [-k] - report mismatch
+in current ordering.
+
+
Graph of the dependencies:
+/usr/share/insserv/check-initd-order -g - for reviewing dependencies
+
+
Enabling dependency based boot sequencing I
+
+
+
+ - Use the insserv package in unstable and testing
+
- Low priority debconf question.
+
- Only enabled after verfiying that it is safe to enable
+
- Converts all start symlinks in rc0.d/ and rc6.d with stop symlinks.
+
- Replaces update-rc.d with wrapper calling insserv
+
- All of rc*.d/ is reordered
+
+
+Enabling dependency based boot sequencing II
+
+
+# aptitude install insserv
+# dpkg-reconfigure insserv
+info: Checking if it is safe to convert to dependency based boot.
+info: Backing up existing boot scripts in \
+ /var/lib/insserv/bootscripts-20080223T0742.tar.gz
+info: Reordering boot system, log to \
+ /var/lib/insserv/run-20080223T0742.log
+info: Recording new boot sequence in \
+ /var/lib/insserv/bootscripts-20080223T0742-after.list
+info: Use '/usr/sbin/update-bootsystem-insserv \
+ restore' to restore the old boot sequence.
+Adding `diversion of /usr/sbin/update-rc.d to \
+ /usr/sbin/update-rc.d.distrib by insserv'
+success: Boot system successfully converted
+# /var/lib/insserv/insserv-seq-changes \
+ /var/lib/insserv/bootscripts-20080223T0742.tar.gz
+#
+
+
+With dependency based boot sequencing
+
+update-rc.d refuse to Insert scripts which create a loop.
+
+update-rc.d require scripts to be inserted in dependency order.
+
+Incorrect dependencies give the wrong boot and shutdown order.
+
+It is possible to enable concurrent booting, running boot scripts
+ in parallel (CONCURRENCY=startpar in /etc/default/rcS)
+
+Disabling dependency based boot sequencing
+
+Run dpkg-reconfigure insserv and disable it.
+
+
It is always possible to disable just after it was enabled, before
+any new packages are installed.
+To disable it, a backup of the old boot sequence is restored if no
+changes has been done to the boot sequence since it was enabled.
+
+
If restoring is not possible, All postinst scripts for packages
+with init.d scripts will be executed again to get them to call
+update-rc.d and add the boot scripts again.
LSB headers for insserv
@@ -223,14 +307,6 @@ is the header for you:
$remote_fs is needed by all scripts using files in /usr/. $syslog
is needed only by scripts starting services logging to syslog.
-What to list as dependencies II
-
-In the common case, the start and stop dependencies are identical.
-
-
Prefer virtual dependencies over specific dependencies
-
-XXX More
-
Virtual facilities
Linux Software Base version 3.2 define these virtual facilities:
@@ -273,6 +349,23 @@ facility, then that daemon has been started.
All of these represent points in time during boot and shutdown.
+
What to list as dependencies II
+
+Normally, the start and stop dependencies are the same.
+
+
Prefer virtual dependencies over specific dependencies.
+
+
When using specific dependencies, use the string listed in the
+ provides header of the scripts you depend on.
+
+
Scripts started in rcS.d/ need extra care.
+
+
Depend on $remote_fs unless started in rcS.d/. Make sure /usr/ is
+available during start and that it is stopped before sendsigs kill all
+processes during shutdown.
+
+XXX More
+
Status of dependency based boot
@@ -280,22 +373,31 @@ facility, then that daemon has been started.
Release goal for Debian Lenny.
Packages with LSB header (in Sid): 654 of 866 (76%)
-
Unsolved BTS reports: XXX
+
Unsolved BTS reports: 85
Packages without BTS reports: ~150
Last package projected fixed 2008-07-19 with the current rate
Need better documentation
-
Need debian policy updates
+
Should update Debian policy to reflect this new feature.
-
Fix insserv bugs
+
Two insserv bugs to fix.
+
+- Avoid adding unwanted stop symlinks.
+
- Do not fail on "fake" loops. (minor)
+
+
Tracking status
+debian/rules missing-overrides
+debian/rules missing-by-popcon
+
References
http://wiki.debian.org/LSBInitScripts
http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
+svn+ssh://svn.debian.org/svn/initscripts-ng/trunk/src/insserv
Thank you very much
diff --git a/mypapers/200802-bootsequence/insserv-enable.png b/mypapers/200802-bootsequence/insserv-enable.png
new file mode 100644
index 0000000000..f676142870
Binary files /dev/null and b/mypapers/200802-bootsequence/insserv-enable.png differ
diff --git a/mypapers/200802-bootsequence/sid-base-boot-20080220.dot b/mypapers/200802-bootsequence/sid-base-boot-20080220.dot
new file mode 100644
index 0000000000..695f99af8a
--- /dev/null
+++ b/mypapers/200802-bootsequence/sid-base-boot-20080220.dot
@@ -0,0 +1,106 @@
+# Generating graph
+digraph packages {
+#rankdir=LR;
+concentrate=true;
+"glibc" [shape=box];
+"glibc" -> "hostname"[color=springgreen] ;
+"hostname" [shape=box];
+"glibc" -> "mountkernfs"[color=springgreen] ;
+"mountkernfs" [shape=box];
+"mountkernfs" -> "mountdevsubfs"[color=blue] ;
+"udev" -> "mountdevsubfs"[color=springgreen] ;
+"mountdevsubfs" [shape=box];
+"mountdevsubfs" -> "bootlogd"[color=blue] ;
+"bootlogd" [shape=box];
+"mountdevsubfs" -> "hwclockfirst"[color=blue] ;
+"hwclockfirst" [shape=box];
+"mountdevsubfs" -> "checkroot"[color=blue] ;
+"hostname" -> "checkroot"[color=blue] ;
+"keymap" -> "checkroot"[color=springgreen] ;
+"hwclockfirst" -> "checkroot"[color=springgreen] ;
+"hdparm" -> "checkroot"[color=springgreen] ;
+"bootlogd" -> "checkroot"[color=springgreen] ;
+"checkroot" [shape=box];
+"hwclock" -> "$time"[color=blue] ;
+"$time" [shape=box];
+"mountdevsubfs" -> "hwclock"[color=blue] ;
+"hwclock" [shape=box];
+"checkroot" -> "mtab"[color=blue] ;
+"mtab" [shape=box];
+"checkroot" -> "ifupdown-clean"[color=blue] ;
+"ifupdown-clean" [shape=box];
+"checkroot" -> "module-init-tools"[color=springgreen] ;
+"module-init-tools" [shape=box];
+"checkroot" -> "checkfs"[color=blue] ;
+"mtab" -> "checkfs"[color=springgreen] ;
+"cryptdisks" -> "checkfs"[color=springgreen] ;
+"checkfs" [shape=box];
+"mountkernfs" -> "procps"[color=blue] ;
+"procps" [shape=box];
+"$local_fs" -> "$remote_fs"[color=blue] ;
+"$remote_fs" [shape=box];
+"mountall" -> "$local_fs"[color=blue] ;
+"$local_fs" [shape=box];
+"checkfs" -> "mountall"[color=blue] ;
+"mountall" [shape=box];
+"mountall" -> "mountall-bootclean"[color=blue] ;
+"mountall-bootclean" [shape=box];
+"$local_fs" -> "$remote_fs"[color=blue] ;
+"$remote_fs" [shape=box];
+"mountoverflowtmp" -> "$local_fs"[color=blue] ;
+"$local_fs" [shape=box];
+"mountall-bootclean" -> "mountoverflowtmp"[color=blue] ;
+"mountoverflowtmp" [shape=box];
+"$network" -> "$named"[color=blue] ;
+"$named" [shape=box];
+"ifupdown" -> "$network"[color=blue] ;
+"$network" [shape=box];
+"ifupdown-clean" -> "ifupdown"[color=blue] ;
+"ifupdown" [shape=box];
+"$network" -> "$named"[color=blue] ;
+"$named" [shape=box];
+"networking" -> "$network"[color=blue] ;
+"$network" [shape=box];
+"mountkernfs" -> "networking"[color=blue] ;
+"ifupdown" -> "networking"[color=blue] ;
+"$local_fs" -> "networking"[color=blue] ;
+"networking" [shape=box];
+"mountnfs" -> "$remote_fs"[color=blue] ;
+"$remote_fs" [shape=box];
+"$local_fs" -> "mountnfs"[color=blue] ;
+"$network" -> "mountnfs"[color=springgreen] ;
+"nfs-common" -> "mountnfs"[color=springgreen] ;
+"udev-mtab" -> "mountnfs"[color=springgreen] ;
+"mountnfs" [shape=box];
+"mountnfs-bootclean" -> "$remote_fs"[color=blue] ;
+"$remote_fs" [shape=box];
+"mountnfs" -> "mountnfs-bootclean"[color=blue] ;
+"mountnfs-bootclean" [shape=box];
+"$remote_fs" -> "bootmisc"[color=blue] ;
+"bootmisc" [shape=box];
+"$local_fs" -> "urandom"[color=blue] ;
+"urandom" [shape=box];
+"$remote_fs" -> "stop-bootlogd-single"[color=blue] ;
+"$all" -> "stop-bootlogd-single"[color=blue] ;
+"stop-bootlogd-single" [shape=box];
+"sysklogd" -> "$syslog"[color=blue] ;
+"$syslog" [shape=box];
+"$local_fs" -> "sysklogd"[color=blue] ;
+"$time" -> "sysklogd"[color=blue] ;
+"$network" -> "sysklogd"[color=springgreen] ;
+"sysklogd" [shape=box];
+"sysklogd" -> "klogd"[color=blue] ;
+"klogd" [shape=box];
+"$remote_fs" -> "cron"[color=blue] ;
+"$syslog" -> "cron"[color=blue] ;
+"$time" -> "cron"[color=blue] ;
+"cron" [shape=box];
+"$remote_fs" -> "rc.local"[color=blue] ;
+"rc.local" [shape=box];
+"$remote_fs" -> "rmnologin"[color=blue] ;
+"$all" -> "rmnologin"[color=blue] ;
+"rmnologin" [shape=box];
+"$remote_fs" -> "stop-bootlogd"[color=blue] ;
+"rmnologin" -> "stop-bootlogd"[color=blue] ;
+"stop-bootlogd" [shape=box];
+}
diff --git a/mypapers/200802-bootsequence/sid-base-seqchanges.txt b/mypapers/200802-bootsequence/sid-base-seqchanges.txt
new file mode 100644
index 0000000000..cb2961f9f4
--- /dev/null
+++ b/mypapers/200802-bootsequence/sid-base-seqchanges.txt
@@ -0,0 +1,94 @@
+Runlevel S
+glibc.sh 1 1 0
+hostname.sh 2 2 0
+mountkernfs.sh 3 3 0
+mountdevsubfs.sh 4 4 0
+procps 5 13 -8
+bootlogd 6 5 1
+hwclockfirst.sh 7 6 1
+checkroot.sh 8 7 1
+ifupdown-clean 9 10 -1
+module-init-tools 10 11 -1
+mtab.sh 11 9 2
+checkfs.sh 12 12 0
+mountall.sh 13 14 -1
+mountall-bootclean.sh 14 15 -1
+mountoverflowtmp 15 16 -1
+hwclock.sh 16 8 8
+ifupdown 17 17 0
+urandom 18 22 -4
+networking 19 18 1
+mountnfs.sh 20 19 1
+mountnfs-bootclean.sh 21 20 1
+bootmisc.sh 22 21 1
+stop-bootlogd-single 23 23 0
+
+Runlevel 0
+klogd 1 3 -2
+sendsigs 2 5 -3
+sysklogd 3 4 -1
+umountnfs.sh 4 7 -3
+networking 5 8 -3
+hwclock.sh 6 1 5
+ifupdown 7 9 -2
+urandom 8 6 2
+mountoverflowtmp 9 2 7
+hwclockfirst.sh 10 ---
+umountfs 11 10 1
+umountroot 12 11 1
+halt 13 12 1
+
+Runlevel 1
+K_cron 1 1 0
+K_klogd 2 2 0
+K_sysklogd 3 3 0
+S_killprocs 4 4 0
+S_single 5 5 0
+
+Runlevel 2
+S_sysklogd 1 1 0
+S_klogd 2 2 0
+S_cron 3 3 0
+S_rc.local 4 4 0
+S_stop-bootlogd 5 6 -1
+S_rmnologin 6 5 1
+
+Runlevel 3
+S_sysklogd 1 1 0
+S_klogd 2 2 0
+S_cron 3 3 0
+S_rc.local 4 4 0
+S_stop-bootlogd 5 6 -1
+S_rmnologin 6 5 1
+
+Runlevel 4
+S_sysklogd 1 1 0
+S_klogd 2 2 0
+S_cron 3 3 0
+S_rc.local 4 4 0
+S_stop-bootlogd 5 6 -1
+S_rmnologin 6 5 1
+
+Runlevel 5
+S_sysklogd 1 1 0
+S_klogd 2 2 0
+S_cron 3 3 0
+S_rc.local 4 4 0
+S_stop-bootlogd 5 6 -1
+S_rmnologin 6 5 1
+
+Runlevel 6
+klogd 1 3 -2
+sendsigs 2 5 -3
+sysklogd 3 4 -1
+umountnfs.sh 4 7 -3
+networking 5 8 -3
+hwclock.sh 6 1 5
+ifupdown 7 9 -2
+urandom 8 6 2
+mountoverflowtmp 9 2 7
+hwclockfirst.sh 10 ---
+umountfs 11 10 1
+umountroot 12 11 1
+reboot 13 12 1
+
diff --git a/mypapers/200802-bootsequence/sid-base-shutdown-20080220.dot b/mypapers/200802-bootsequence/sid-base-shutdown-20080220.dot
new file mode 100644
index 0000000000..2233eaa7b4
--- /dev/null
+++ b/mypapers/200802-bootsequence/sid-base-shutdown-20080220.dot
@@ -0,0 +1,23 @@
+# Generating graph
+digraph packages {
+rankdir=LR;
+concentrate=true;
+"hwclock" -> "$time"[color=blue] ;
+"$time" [shape=box];
+"$local_fs" -> "hwclock"[color=blue] ;
+"hwclock" [shape=box];
+"$local_fs" -> "$remote_fs"[color=blue] ;
+"$remote_fs" [shape=box];
+"mountoverflowtmp" -> "$local_fs"[color=blue] ;
+"$local_fs" [shape=box];
+"umountfs" -> "mountoverflowtmp"[color=blue] ;
+"mountoverflowtmp" [shape=box];
+"sysklogd" -> "klogd"[color=blue] ;
+"klogd" [shape=box];
+"sysklogd" -> "$syslog"[color=blue] ;
+"$syslog" [shape=box];
+"$network" -> "sysklogd"[color=springgreen] ;
+"$local_fs" -> "sysklogd"[color=blue] ;
+"$time" -> "sysklogd"[color=blue] ;
+"sysklogd" [shape=box];
+}