]> pere.pagekite.me Git - homepage.git/commitdiff
Update to current version.
authorPetter Reinholdtsen <pere@hungry.com>
Sat, 23 Feb 2008 09:26:13 +0000 (09:26 +0000)
committerPetter Reinholdtsen <pere@hungry.com>
Sat, 23 Feb 2008 09:26:13 +0000 (09:26 +0000)
mypapers/200802-bootsequence/200802-bootsequence.html
mypapers/200802-bootsequence/insserv-enable.png [new file with mode: 0644]
mypapers/200802-bootsequence/sid-base-boot-20080220.dot [new file with mode: 0644]
mypapers/200802-bootsequence/sid-base-seqchanges.txt [new file with mode: 0644]
mypapers/200802-bootsequence/sid-base-shutdown-20080220.dot [new file with mode: 0644]

index 21e9e045bf8c7ebf1c9468cd49ac310e630a227a..bdd895755631f8fc667c982bfde2c790181b3437 100644 (file)
@@ -6,6 +6,11 @@
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <meta name="Language" content="en">
     <meta name="Author" content="Petter Reinholdtsen">
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <meta name="Language" content="en">
     <meta name="Author" content="Petter Reinholdtsen">
+<style type="text/css">
+PRE {
+  font-size: smaller
+}
+</style>
   </head>
   <body>
 
   </head>
   <body>
 
@@ -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 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
    - how to test it
+   - overriding included headers
  - speed change?
  - concurrency
 
  - speed change?
  - concurrency
 
@@ -104,6 +113,9 @@ The very early boot is done before hard drive partitions is mounted.</p>
 
 </ol>
 
 
 </ol>
 
+<p>Note that because the Linux kernel is becoming more and more event
+based, the boot sequence is no longer sequencial.<p>
+
 <h2>SysV init in Debian - Switching runlevels</h2>
 
 <ul>
 <h2>SysV init in Debian - Switching runlevels</h2>
 
 <ul>
@@ -127,9 +139,15 @@ maintenance.</p>
 
 <h2>SysV init in Debian - Shutting down</h2>
 
 
 <h2>SysV init in Debian - Shutting down</h2>
 
-<p>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 <tt>stop</tt> argument.
+<p>This is roughtly equivalent to switching to runlevel 0 (halt) or 6
+(reboot).</p>
+
+<p>Minor exception: all scripts (both start and stop) are executed
+  with the <tt>stop</tt> argument, ignoring their start and stop
+  setting and confusing script writers.</p>
+
+<p>Only stop scripts for services started in the previous runlevel is
+  executed.</p>
 
 <h2>The ordering problem</h2>
 
 
 <h2>The ordering problem</h2>
 
@@ -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.</p>
 
 sequencing, provided in the insserv package.  Uses format specified in
 Linux Software Base to document dependencies.</p>
 
+<h2>Checking the current boot sequence</h2>
+
+<p>Static checking of current headers:
+<tt>/usr/share/insserv/check-initd-order [-o] [-k]</tt> - report mismatch
+in current ordering.
+
+<p>Graph of the dependencies:
+<a href="sid-base-boot-20080220.dot"><tt>/usr/share/insserv/check-initd-order -g</tt></a> - for reviewing dependencies
+
+<h2>Enabling dependency based boot sequencing I</h2>
+
+<p><a href="insserv-enable.png"><img align="right" src="insserv-enable.png" width="50%"></a>
+<ul>
+  <li>Use the insserv package in unstable and testing
+  <li>Low priority debconf question.
+  <li>Only enabled after verfiying that it is safe to enable
+  <li>Converts all start symlinks in rc0.d/ and rc6.d with stop symlinks.
+  <li>Replaces update-rc.d with wrapper calling insserv
+  <li>All of rc*.d/ is reordered
+</ul>
+
+<h2>Enabling dependency based boot sequencing II</h2>
+
+<p><pre size="-1">
+# 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
+# <a href="sid-base-seqchanges.txt">/var/lib/insserv/insserv-seq-changes \
+  /var/lib/insserv/bootscripts-20080223T0742.tar.gz</a>
+#
+</pre>
+
+<h2>With dependency based boot sequencing</h2>
+
+<p>update-rc.d refuse to Insert scripts which create a loop.</p>
+
+<p>update-rc.d require scripts to be inserted in dependency order.</p>
+
+<p>Incorrect dependencies give the wrong boot and shutdown order.</p>
+
+<p>It is possible to enable concurrent booting, running boot scripts
+  in parallel (CONCURRENCY=startpar in /etc/default/rcS)</p>
+
+<h2>Disabling dependency based boot sequencing</h2>
+
+<p>Run <tt>dpkg-reconfigure insserv</tt> and disable it.
+
+<p>It is always possible to disable just after it was enabled, before
+any new packages are installed.</p>
 
 
+<p>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.
+
+<p>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.
 
 <h2>LSB headers for insserv</h2>
 
 
 <h2>LSB headers for insserv</h2>
 
@@ -223,14 +307,6 @@ is the header for you:</p>
 <p>$remote_fs is needed by all scripts using files in /usr/.  $syslog
 is needed only by scripts starting services logging to syslog.</p>
 
 <p>$remote_fs is needed by all scripts using files in /usr/.  $syslog
 is needed only by scripts starting services logging to syslog.</p>
 
-<h2>What to list as dependencies II</h2>
-
-<p>In the common case, the start and stop dependencies are identical.
-
-<p>Prefer virtual dependencies over specific dependencies
-
-XXX More
-
 <h2>Virtual facilities</h2>
 
 <p>Linux Software Base version 3.2 define these virtual facilities:
 <h2>Virtual facilities</h2>
 
 <p>Linux Software Base version 3.2 define these virtual facilities:
@@ -273,6 +349,23 @@ facility, then that daemon has been started.
 
 <p>All of these represent points in time during boot and shutdown.
 
 
 <p>All of these represent points in time during boot and shutdown.
 
+<h2>What to list as dependencies II</h2>
+
+<p>Normally, the start and stop dependencies are the same.
+
+<p>Prefer virtual dependencies over specific dependencies.
+
+<p>When using specific dependencies, use the string listed in the
+  provides header of the scripts you depend on.
+
+<p>Scripts started in rcS.d/ need extra care.
+
+<p>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.</p>
+
+XXX More
+
 <h2>Status of dependency based boot</h2>
 
 <img alt="LSB header progress graph" src="lsb-header-progress.png" width="50%" align="right">
 <h2>Status of dependency based boot</h2>
 
 <img alt="LSB header progress graph" src="lsb-header-progress.png" width="50%" align="right">
@@ -280,22 +373,31 @@ facility, then that daemon has been started.
 <p>Release goal for Debian Lenny.
 
 <p>Packages with LSB header (in Sid): 654 of 866 (76%)
 <p>Release goal for Debian Lenny.
 
 <p>Packages with LSB header (in Sid): 654 of 866 (76%)
-<br>Unsolved BTS reports: XXX
+<br>Unsolved BTS reports: 85
 <br>Packages without BTS reports: ~150
 <br>Last package projected fixed 2008-07-19 with the current rate
 
 <p>Need better documentation
 
 <br>Packages without BTS reports: ~150
 <br>Last package projected fixed 2008-07-19 with the current rate
 
 <p>Need better documentation
 
-<p>Need debian policy updates
+<p>Should update  Debian policy to reflect this new feature.
 
 
-<p>Fix insserv bugs
+<p>Two insserv bugs to fix.
+<ul>
+<li>Avoid adding unwanted stop symlinks.
+<li>Do not fail on "fake" loops. (minor)
+</ul></p>
 
 <p>
 
 
 <p>
 
+<h2>Tracking status</h2>
+debian/rules missing-overrides
+debian/rules missing-by-popcon
+
 <h2>References</h2>
 
 http://wiki.debian.org/LSBInitScripts
 http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
 <h2>References</h2>
 
 http://wiki.debian.org/LSBInitScripts
 http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
+svn+ssh://svn.debian.org/svn/initscripts-ng/trunk/src/insserv
 
     <h2>Thank you very much</h2>
 
 
     <h2>Thank you very much</h2>
 
diff --git a/mypapers/200802-bootsequence/insserv-enable.png b/mypapers/200802-bootsequence/insserv-enable.png
new file mode 100644 (file)
index 0000000..f676142
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 (file)
index 0000000..695f99a
--- /dev/null
@@ -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 (file)
index 0000000..cb2961f
--- /dev/null
@@ -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 (file)
index 0000000..2233eaa
--- /dev/null
@@ -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];
+}