]> pere.pagekite.me Git - homepage.git/blobdiff - mypapers/200802-bootsequence/200802-bootsequence.html
Minor fixes.
[homepage.git] / mypapers / 200802-bootsequence / 200802-bootsequence.html
index 8f5741091e68afaf54889c04a061ddea0a267ddd..772f7c7b143424cd032fbd95c639b4e5ec2ee0cd 100644 (file)
@@ -1,6 +1,7 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
   <head>
+  <title>Talk: Reordering the Debian boot sequence for correctness and speed</title>
     <link rel="stylesheet" href="../mrtg-td/slides.css" type="text/css">
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <meta name="Language" content="en">
@@ -8,18 +9,41 @@
   </head>
   <body>
 
-<a href="200706-bootseq/200706-bootseq.html">forrige foredrag</a>
+<a href="../200706-bootseq/200706-bootseq.html">last related talk</a>
 
-<h1>Reordering the Debian boot sequence for correctness and speed</h1>
+<h1><A href="http://www.fosdem.org/2008/schedule/events/debian_boot">Reordering the Debian boot sequence for correctness and speed</a></h1>
 
-<p>Autodetecting and configuring hardware during installation and at
-   runtime</p>
+<p>There are subtle bugs in the Debian boot and shutdown sequence.
+They are hard to find, as they normally only affect rare combination
+of packages, and harder to fix, as they normally require the combined
+work of several maintainers and changes in several packages.  This
+talk is about the release goal for Lenny to solve them, and gain a few
+advantages on the way.</p>
 
-<div class="presenter">Petter Reinholdtsen
+<div class="presenter">Petter Reinholdtsen - one of the sysvinit maintainers
   <br>pere@hungry.com
   <br>FOSDEM 2008, 2008-02-26</div>
 
-<h2>Summary</h2>
+<!--
+
+There are subtle bugs in the debian boot and shutdown sequence. They
+are hard to find, as they normally only affect rare combination of
+packages, and harder to fix, as they normally require the combined
+work of several maintainers and changes in several packages.
+
+One way to find these bugs is to document the dependencies of all
+init.d scripts, and use this information to check that the ordering is
+correct. When such information is available, it is also possible to
+reorder the boot and shutdown sequence to make sure all dependencies
+are fulfilled.
+
+It is also possible to run scripts in parallel, to speed up the boot,
+when the order they need to run in is known.
+
+This talk is about how all of this can be done with Debian.
+-->
+
+<h2>Outline</h2>
 
 <!--
 
    - runlevels
    - inittab
    - rc*.d/
- - ordering issue
+ - ordering problem
  - how does it work in debian
  - effect on the boot
  - insserv
+   - how to test it
  - speed change?
  - concurrency
 
@@ -106,13 +131,58 @@ maintenance.</p>
   with a minor exception.  All scripts (both start and stop) are
   executed with the <tt>stop</tt> argument.
 
-<h2> about ordering </h2>
+<h2>The ordering problem</h2>
 
 <p>Script ordering is vital for this to work.  And how are the scripts
-ordered?
+ordered?  By numbers.
+
+<p>And the numbers are picked using skills, knowledge and negotiation.
+Getting it right is often hard.
+
+<p>The current Debian default is wrong.  Stop sequence should by
+default be the reverse of the start sequence.  It isn't.
+
+<p>Reordering is hard and require cooperation between maintainers of
+all packages involved.
+
+<h2>The ordering problem - an example</h2>
+
+<p>Given two packages with two scripts inserted with the default
+settings in Debian:
+
+<p>Package A: script_a sequence 20 (start and stop)
+<br>Package B: script_b sequence 20 (start and stop)
+
+<p>Along come script C, which should run before script_a and after
+script_b.  Current solution is to change packages A and C or packages
+B and C to get something like this:
+
+<p>Package A: script_a start seq. 22, stop seq. 18
+<br>Package B: script_b sequence 20 (start and stop)
+<br>Package C: script_c start seq 21, stop seq 19
+
+<p>If other scripts depend on the old order of script_a, they will
+have to change their sequence number too.  Only way to discover this
+is by a lot of testing, or documenting script dependencies.
+
+<h2>An ordering solution</h2>
+
+<p>Let each script document its dependency, and generate sequence
+numbers using this dependency information.  Example:
+
+<p>Package A: script_a depend on nothing
+<br>Package B: script_b depend on nothing
+<br>Package C: script_c depend on script_b, a dependency of script_a
+
+<p>Generated sequence:
 
- update-rc.d numbers.
+<p>script_b start seq 1, stop seq 3
+<br>script_c start seq 2, stop seq 2
+<br>script_a start seq 3, stop seq 1
 
+<p>An implementation of this system is the dependency based boot
+sequencing, provided in the insserv package.  Uses format specified in
+Linux Software Base to document dependencies.</p>
 
 
 
@@ -153,6 +223,53 @@ 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>
 
+<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
+
+<h2>Virtual facilities</h2>
+
+<p>Linux Software Base version 3.2 define these virtual facilities:
+
+<dl>
+
+<dt>$local_fs
+<dd>all local file systems are mounted. (In Debian, / and /var/ is available)
+
+<dt>$network
+<dd>basic networking support is available. Example: a server program
+could listen on a socket. (In Debian, network interfaces are up)
+
+<dt>$portmap
+<dd>daemons providing SunRPC/ONCRPC portmapping service as defined in
+RFC 1833: Binding Protocols for ONC RPC Version 2 (if present) are
+running.
+
+<dt>$remote_fs
+<dd>all remote file systems are available. In some configurations,
+file systems such as /usr may be remote. Many applications that
+require $local_fs will probably also require $remote_fs. (In Debian,
+/usr/ and NFS directories are guaranteed to be mounted)
+
+<dt>$time
+<dd>the system time has been set, for example by using a network-based
+time program such as ntp or rdate, or via the hardware Real Time
+Clock.
+
+<dt>$syslog
+<dd>system logger is operational.
+
+<dt>$named
+<dd>IP name-to-address translation, using the interfaces described in
+this specification, are available to the level the system normally
+provides them. Example: if a DNS query daemon normally provides this
+facility, then that daemon has been started.
+
+</dl>
+
+<p>All of these represent points in time during boot and shutdown.
 
 <h2>Status of dependency based boot</h2>
 
@@ -163,18 +280,20 @@ is needed only by scripts starting services logging to syslog.</p>
 <p>Packages with LSB header: 654 of 866 (76%)
 <br>Unsolved BTS reports: XXX
 <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>
+<p>Fix insserv bugs
 
- - status in debian
-   - need better doc
-   - fix insserv bugs
+<p>
 
+<h2>References</h2>
 
+http://wiki.debian.org/LSBInitScripts
+http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
 
     <h2>Thank you very much</h2>