--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <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">
+ <meta name="Author" content="Petter Reinholdtsen">
+ </head>
+ <body>
+
+<a href="200706-bootseq/200706-bootseq.html">forrige foredrag</a>
+
+<h1>Reordering the Debian boot sequence for correctness and speed</h1>
+
+<p>Autodetecting and configuring hardware during installation and at
+ runtime</p>
+
+<div class="presenter">Petter Reinholdtsen
+ <br>pere@hungry.com
+ <br>FOSDEM 2008, 2008-02-26</div>
+
+<h2>Summary</h2>
+
+<!--
+
+ - how do sysvinit boot work
+ - runlevels
+ - inittab
+ - rc*.d/
+ - ordering issue
+ - how does it work in debian
+ - effect on the boot
+ - insserv
+ - speed change?
+ - concurrency
+
+ - how to write lsb headers
+ - provides
+ - deps
+ - runlevel list
+
+ - status in debian
+ - need better doc
+ - fix insserv bugs
+
+ - what is needed to convert
+ - add LSB header to packages and get the change into testing
+ - update policy
+ - more users to test headers and detect errors
+ - install and activate insserv by default
+
+-->
+
+<h2>SysV init in Debian - Booting</h2>
+
+<p>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.</p>
+
+<ol>
+
+<li>/sbin/init start, which look at /etc/inittab and decides what to
+ do.</li>
+
+<li>The scripts in /etc/rcS.d/ is executed in sequence by
+ /etc/init.d/rc, with <tt>start</tt> as the argument.</li>
+
+<li>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 <tt>stop</tt> as their
+ argument, next the start scripts with <tt>start</tt> as their
+ argument. The rc*.d/ directories contain symlinks the files in to
+ /etc/init.d/.</li>
+
+<li>The ordering is important.</li>
+
+<li>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.</li>
+
+</ol>
+
+<h2>SysV init in Debian - Switching runlevels</h2>
+
+<ul>
+
+<li>Call <tt>telinit X</tt> where X is the new runlevel, one of S, 0,
+ 1, 2, 3, 4, 5, 6.</li>
+
+<li>init runs in sequence all stop scripts in /etc/rcX.d/ that also
+ has a start symlink in the previous runlevel /etc/rcY.d/, with
+ <tt>stop</tt> as their argument.</li>
+
+<li>init then run in sequence all start scripts in /etc/rcX.d/, with
+ <tt>start</tt> as their argument.</li>
+
+</ul>
+
+<p>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.</p>
+
+<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.
+
+<h2> about ordering </h2>
+
+<p>Script ordering is vital for this to work. And how are the scripts
+ordered?
+
+ update-rc.d numbers.
+
+
+
+
+<h2>LSB headers for insserv</h2>
+
+<ul>
+ <li>"Provides" header, list the Facility/service provided by the
+ script. Do not list virtual facilities (like $time)</li>
+
+ <li>Runlevel entries (Default-Start and Default-Stop headers), list
+ what runlevels to activate for this script
+
+ <li>Dependency entries (Required-Start, Required-Stop, Should-Start,
+ Should-Stop, X-Start-Before, X-Stop-After), list the
+ facilities/services needed by this script. It will start after
+ its start dependencies and stop before its stop dependencies. The
+ X-* entreis are reverse dependencies. Required-* are hard
+ dependencies (will install even if they are missing), while
+ Should-* and X-* are soft dependencies (only taken into account if
+ scripts providing them are present).</li>
+
+</ul>
+
+<h2>What to list as dependencies I</h2>
+
+<p>If your package used the default update-rc.d settings before, this
+is the header for you:</p>
+<pre>
+### 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
+</pre>
+
+<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>Status of dependency based boot</h2>
+
+<img alt="LSB header progress graph" src="lsb-header-progress.png" width="50%" align="right">
+
+<p>Release goal for Debian Lenny.
+
+<p>Packages with LSB header: 654 of 866 (76%)
+<br>Unsolved BTS reports: XXX
+<br>Packages without BTS reports: ~150
+
+<p>Need better documentation
+
+<p>Need debian policy updates
+
+<p>
+
+ - status in debian
+ - need better doc
+ - fix insserv bugs
+
+
+
+ <h2>Thank you very much</h2>
+
+ <h3>Questions?</h3>
+
+ <p><a href="http://www.hungry.com/~pere/mypapers/200802-bootsequence/200802-bootsequence.html">http://www.hungry.com/~pere/mypapers/200802-bootsequence/200802-bootsequence.html</a></p>
+
+ </body>
+</html>