Differences between revisions 52 and 192 (spanning 140 versions)
Revision 52 as of 2008-01-05 23:06:49
Size: 18883
Editor: ?PetterReinholdtsen
Comment: Update package list. Remove solved issues.
Revision 192 as of 2015-09-21 08:48:11
Size: 11040
Comment: Clarified applicability to Jessie.
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
#language en
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: none-~
----
Line 4: Line 7:
It is possible to converting Debian to order the boot sequence using the
LSB headers in the init.d scripts. This will get rid of several bugs in the
current boot sequence, and make it easier to keep the sequence correct.
Before Debian 8.0, Debian used init to boot-up the system. This page provide information of the details to resolve the dependency issues. Since Debian 8.0, Systemd replaced init and the dependency was relied on its target files. The information described here no longer applies to Debian's default in Jessie.

Debian was converted to order the boot sequence using the LSB fields in the header of each init.d script. This has removed several bugs in the former boot sequence, and now makes it easier to keep the sequence correct.
Line 9: Line 12:
Did you ever need to insert a init.d scripts Y before init.d scripts Z and after init.d script X, where both Z and X is started using boot sequence number 20 (as in 20X and 20Z)? Adding your script as 20Y would not cut it, because you need Z to start before X. To do this, in Debian you currently need to talk to the maintainer of packages with scripts Z and X, asking one of them (or both) to move their script into a different number. Dependency based boot sequencing make it possible for each package maintainer to specify the dependencies of its scripts, and leave the number allocation to the dependency resolver.
Line 10: Line 14:
Did you every need to insert a init.d scripts Y before init.d scripts
Z and after init.d script X, where both Z and X is started using boot
sequence number 20 (as in 20X and 20Z)? Adding your script as 20Y
would not cut it, because you need Z to start before X. To do this,
in Debian you currently need to talk to the maintainer of packages
with scripts Z and X, asking one of them (or both) to move their
script into a different number. Dependency based boot sequencing make
it possible for each package maintainer to specify the dependencies of
its scripts, and leave the number allocation to the dependency
resolver.
Some examples of such problems are DebianBug:256699 DebianBug:294053, DebianBug:279297, DebianBug:311057 and DebianBug:475626 .


== How to add a service when using dependency-based booting ==

In Debian releases '''prior to 6.0''', a service could be added with update-rc.d:

{{{
update-rc.d mydaemon defaults
}}}

Starting with Debian 6.0, the insserv command is used instead, if dependency-based booting is enabled:

{{{
insserv mydaemon
}}}

Where ''mydaemon'' is an executable init script placed in /etc/init.d. insserv will produce no output if everything went OK. Examine the error code in $? if you want to be sure.

Both the old and the new way requires an init script to be present in /etc/init.d. For dependency-based booting, the script needs to be an [[LSBInitScripts|LSB init script]].

As of Debian 7 [[http://manpages.debian.org/cgi-bin/man.cgi?query=insserv&apropos=0&sektion=0&manpath=Debian+7.0+wheezy&format=html&locale=en|man insserv]] states

 insserv is a low level tool used by update-rc.d which enables an installed system init script (`boot script') by reading the comment header of the script

so you need not use it ''instead'' of update-rc.d - see your local manpage for details.

== History of the feature ==

The feature was [[http://alioth.debian.org/docman/view.php/30730/38/debconf2-initscripts-bkg.pdf|proposed at debconf in 2002]], and has been worked on since before 2006, and [[http://lists.debian.org/debian-devel-announce/2008/01/msg00004.html|was announced on debian-devel-announce]] 2008-01-17. A status update message was sent [[http://lists.debian.org/debian-devel-announce/2008/03/msg00011.html|2008-03-16]] and [[http://lists.debian.org/debian-devel-announce/2008/11/msg00007.html|2008-11-30]]. The default in Debian was changed to dependency based boot sequencing 2009-07-27, and an updated announcement about the plans for the boot system was sent out [[http://lists.debian.org/debian-devel-announce/2009/09/msg00003.html|2009-09-05]]. The default in Debian was changed to run scripts in parallel 2010-05-14 and an announcement was sent on [[http://lists.debian.org/debian-devel-announce/2010/05/msg00009.html|2010-05-21]].
Line 23: Line 47:
This page is created to keep track of the state of this feature, to make it easier
to coordinate an effort to implement it for
Debian Lenny. It is [http://lists.debian.org/debian-release/2007/06/msg00164.html proposed] as a [http://release.debian.org/lenny-goals.txt release goal] for Lenny.
This page was created to keep track of the state of this feature, to make it easier to coordinate an effort to implement it in Debian. It was [[http://lists.debian.org/debian-release/2007/06/msg00164.html|proposed]] as a [[http://release.debian.org/lenny-goals.txt|release goal]] for Lenny.  It will be the default boot ordering method for Squeeze.
During Debconf in 2009, the default in Sid was changed to use dependency based boot sequencing by default.
Line 26: Line 50:
|| || 2007-07-03 || 2007-07-22 || 2007-08-08 || 2007-09-06 || 2007-10-24 || 2007-11-14 || 2007-11-29 || 2007-12-22 || 2007-12-30 ||
|| packages with init.d scripts || 843 || 843|| 845 || 849 || 855 || 852 || 851 || 857 || 860 ||
|| fraction with LSB headers || 56% || 57% || 58% || 60% || 62% || 63% || 64% || 66% || 67% ||
|| packages without LSB headers || 373 || 363|| 353 || 336 || 325 || 319 || 303 || 292 || 287 ||
|| base packages without LSB headers || 2 of 40 || || || || || 1 of 40 (1 of 12 pkgs) || || || ||
|| desktop packages without LSB headers || 6 of 58 || || || || || 7 of 70 (7 of 39 pkgs) || || || ||
A number of [[http://bugs.debian.org/cgi-bin/pkgreport.cgi?usertag=initscripts-ng-devel@lists.alioth.debian.org&dist=unstable|bug reports]] are submitted to request LSB fields in init.d scripts. It is useful to track [[http://bugs.debian.org/cgi-bin/pkgreport.cgi?usertag=initscripts-ng-devel@lists.alioth.debian.org&dist=testing|the ones open in testing]] as well.
Line 33: Line 52:
With the current rate (2007-12-30) of packages being fixed to include the dependency information, it will take 410 days until all the remaining packages are fixed. A daily updated archive wide check of init.d scripts is available from
http://lintian.debian.org/~pere/ . [[http://piuparts.debian.org/sid/insserv_error.html|Piuparts]] now reports installation errors due to incorrect dependencies, and [[http://piuparts.debian.org/sid/initdscript_lsb_header_issue.html|inconsistencies]] between update-rc.d calls and LSB fields.
Line 35: Line 55:
A number of [http://bugs.debian.org/cgi-bin/pkgreport.cgi?usertag=initscripts-ng-devel@lists.alioth.debian.org bug reports] are submitted to request LSB headers in init.d scripts. === Plan of migration ===
Line 37: Line 57:
Base packages missing LSB headers: none, all is fixed. This is a proposal for a plan to migrate all of Debian over to dependency based boot sequencing.
Line 39: Line 59:
Desktop packages missing LSB headers: [http://bugs.debian.org/376955 hotkey-setup] [http://bugs.debian.org/448223 anacron] [http://bugs.debian.org/451751 resolvconf]  1. Change the debconf default in DebPkg:insserv to enable dependency based boot sequencing when the package is installed, if it is safe to do so. Show the question again on upgrades if the conversion isn’t done yet. Remove/disable the option to disable DebPkg:insserv after it is enabled.
 1. Change DebPkg:sysv-rc to depend on DebPkg:insserv, to pull it in on all (non-file-rc) installations.
 1. Wait 6 months, while rewriting policy text to document the new way {{{update-rc.d}}} is going to work.
 1. Drop support for specifying sequence numbers in {{{update-rc.d}}}.
Line 41: Line 64:
=== Known issues === This will enable dependency based boot sequencing for all in Debian from Squeeze and onwards.
Line 43: Line 66:
 * There is a dependency loop between sysklogd->$named->bind9->$syslog->sysklogd. When both are installed, insserv is unable to generate a valid boot sequence. A request to break the loop have been filed [http://bugs.debian.org/458265 against the sysklogd] package. == How to solve migration problems ==
Line 45: Line 68:
 * [http://bugs.debian.org/458582 Bug in insserv] make it appear to be a dependency loop between checkfs and hwclockfirst. A [http://bugs.debian.org/458346 workaround/fix] is proposed for the util-linux package. === package X removed but not purged ===
Line 47: Line 70:
 * Some scripts provide the same service, and this confuses insserv. Some of the scripts are scripts that have been removed from their package, but not properly removed from disk. This make insserv refuse to install these init.d scripts. If a script in {{{/etc/init.d/}}} belongs to a package that is removed but not purged, the field is probably missing or is outdated. Purging the package will solve the issue.
Line 49: Line 72:
To see the boot and reboot sequence dependecy graph, use === package X left obsolete init.d script behind ===

The script was probably dropped from its package, but the package
maintainer forgot to add code in the postinst to remove the obsolete
script during upgrades. Removing the script is probably the correct
solution. We have seen [[DebianBug:463632|one report]] where dpkg
would claim that a script
was obsolete one time and not obsolete one upgrade later, so this should
probably be checked a bit before the script is removed.

To verify that a package really left behind obsolete conffiles, one can run

{{{
dpkg-query -W -f='${Conffiles}\n' packagename | grep obsolete
}}}

There are several reasons why these scripts are not removed automatically during upgrades. First of all, reporting these issues exposes bugs that should be fixed in the individual packages. Second, it is hard to know if the script reported was left behind for a strange and particular reason, or just forgotten. And last, there is the one report that a non-obsolete script was reported as obsolete. Still not sure if that was for real or not, but until we know the reason, it seemed risky to just remove scripts in other packages during upgrades. Besides doing so from the sysv-rc postinst would be a policy violation.

=== insserv: warning: script 'X' missing LSB tags and overrides ===

The {{{/etc/init.d/X}}} script is lacking the LSB fields. Adding them
to the script header or as a override file in /etc/insserv/overrides/X would solve it.

=== insserv: script X: service Y already provided! ===

Bug in the package with script X: The facility provided in script
{{{/etc/init.d/X}}} uses a non-unique value. Changing it to a unique
value (for example the script name without .sh ending), solves
the issue.

== Common problems with init.d script header LSB fields ==

Here are some problems I have seen with the LSB fields in init.d scripts during the last three years. I provide it here for those of you wondering if your package’s init.d scripts are correct.

 1. Non-unique Provides field

     When two packages have scripts with the same Provides field, it will only be able to install these packages if the init.d script of the other is not present in {{{/etc/init.d/}}}. Packages sharing a common service with other packages could use virtual facilities instead of conflicting provides, or normal dependencies if few packages are involved.

 2. Incorrect runlevel list

    If the Default-Start and Default-Stop fields do not list the runlevels where a script should be stopped or started, the wrong set of start and stop symlinks will be created when the script is installed, and the boot and shutdown sequence will most likely be incorrect. Fixing it require both updates to the fields, and code in the postinst script to add or remove symlinks that where missing.

 3. Missing dependency on {{{$syslog}}} when logging to syslog

     Without it, services might be started too early during boot and some syslog messages might be lost.

 4. Missing dependency on {{{$remote_fs}}} when needing files in {{{/usr/}}}.

     Scripts starting from {{{rcS.d/}}} will start too early when {{{/usr/}}} is on NFS, and will probably fail to work because some of its expected files and programs are missing when the script starts.

 5. Depending on incorrect or non-existing provides

     The intended relationship with another script does not take effect, making the script run too early or too late during boot and shutdown.

To see the boot and reboot sequence dependency graph, use
Line 58: Line 136:
The number of packages with init.d scripts was counted using {{{apt-file update && apt-file search etc/init.d|cut -d: -f1|sort -u|wc -l}}} in Debian/Sid. The number of packages missing LSB headers are fetched from [http://lintian.debian.org/reports/tags.html the lintian reports] for the [http://lintian.debian.org/reports/Tinit.d-script-missing-lsb-section.html init.d-script-missing-lsb-section] tag. The number of base and desktop packages missing headers were
counted by creating chroots with debootstrap and tasksel.
The list of packages whose init.d script is lacking an LSB header can be fetched from [[http://lintian.debian.org/reports/tags.html|the lintian reports]] for the [[http://lintian.debian.org/reports/Tinit.d-script-missing-lsb-section.html|init.d-script-missing-lsb-section]] tag.
Line 61: Line 138:
To enable dependency based boot, the [http://packages.qa.debian.org/i/insserv.html insserv] package can be used.
At debconf7, Petter Reinholdtsen gave a
[http://user.skolelinux.no/~pere/mypapers/200706-bootseq/200706-bootseq.html talk]
about the dependency based boot system. To enable it, install the insserv package and
activate it like this:
To enable dependency based boot, DebPkg:insserv can be used. At [[http://user.skolelinux.no/~pere/mypapers/200706-bootseq/200706-bootseq.html|debconf7]] and [[http://www.hungry.com/~pere/mypapers/200802-bootsequence/200802-bootsequence.html|FOSDEM 2008]] ([[http://meetings-archive.debian.net/pub/debian-meetings/2008/fosdem/ogg_theora/384x288/Reordering_the_Debian_boot_sequence_for_correctness_and_speed___Petter_Reinholdtsen.ogg|video]]), Petter Reinholdtsen gave a talk about the dependency based boot system. To enable it in older versions of Debian, install DebPkg:insserv and activate it like this:
Line 68: Line 141:
aptitude install insserv && BAD_INSSERV_HACKER=true dpkg-reconfigure insserv aptitude install insserv && dpkg-reconfigure insserv sysv-rc
Line 71: Line 144:
Make sure to use insserv version 1.09.0-6 or higher. Make sure to use DebPkg:insserv version 1.09.0-6 or higher.
Line 73: Line 146:
To usertag related bugs, send an email to request (at) bugs.debian.org,
with content like this:
To usertag related bugs, send an email to request (at) bugs.debian.org, with content like this:
Line 81: Line 154:

== Packages left to fix ==

Generated using {{{dd-list $(lynx -nolist -dump http://lintian.debian.org/reports/Tinit.d-script-missing-lsb-section.html|grep W: |cut -d: -f2)}}}

{{{
Guenter Geiger (Debian/GNU) <geiger@debian.org>
   realtime-lsm

Peter De Schrijver (p2) <p2@mind.be>
   linux-atm

Stefan Hornburg (Racke) <racke@linuxia.de>
   courier
   courier-authlib
   interchange
   pure-ftpd
   sympa

Cyril Lacoux (Yack) <clacoux@easter-eggs.com>
   digitools

Marco Presi (Zufus) <zufus@debian.org>
   linesrv

Stefan Alfredsson <alfs@debian.org>
   monit

Osamu Aoki <osamu@debian.org>
   tpconfig

Ben Armstrong <synrg@sanctuary.nslug.ns.ca>
   xpilot-ng

Don Armstrong <don@debian.org>
   spamass-milter

SZALAY Attila <sasa@debian.org>
   zorp

Artem Baguinski <artm@v2.nl>
   drscheme (U)

Alan Bain <afrb2@debian.org>
   rbootd

Andreas Barth <aba@not.so.argh.org>
   mgetty

Daniel Baumann <daniel@debian.org>
   ipmasq
   nfs-user-server

Hilko Bengen <bengen@debian.org>
   ulog-acctd

Grzegorz Bizon <verdan@pirx.int.pl>
   specter

Bastian Blank <waldi@debian.org>
   lvm2 (U)

Blars Blarson <blarson@blars.org>
   cnews

Achim Bohnet <ach@mpe.mpg.de>
   capisuite (U)

Ed Boraas <ed@debian.org>
   aime
   tinyproxy

W. Borgert <debacle@debian.org>
   blinkd

Cyril Bouthors <cyril@bouthors.org>
   bld
   drbdlinks

Chris Boyle <cmb@debian.org>
   reaim

Joachim Breitner <nomeata@debian.org>
   dmraid (U)

Adrian Bridgett <bridgett@debian.org>
   dante

Eric Van Buggenhaut <ericvb@debian.org>
   udhcp

Bruno Barrera C. <bruno@debian.org>
   portsentry

Patrick Caulfield <patrick@debian.org>
   mopd

Hubert Chathi <uhoreg@debian.org>
   gnustep-base (U)

Emmanuel le Chevoir <mms@debian.org>
   frox

Dennis L. Clark <dbugger@debian.org>
   bnetd

Jesus Climent <jesus.climent@hispalinux.es>
   distmp3
   spamassassin (U)

Russell Coker <rjc@coker.com.au>
   memlockd

Russell Coker <russell@coker.com.au>
   fcron (U)

Jamin W. Collins <jcollins@asgardsrealm.net>
   jabber

Carlo Contavalli <ccontavalli@debian.org>
   wipl

Paul Cupis <paul@cupis.co.uk>
   guarddog
   guidedog

Artur R. Czechowski <arturcz@hell.pl>
   rrdcollect

Marco d'Itri <md@linux.it>
   binkd

Julien Danjou <acid@debian.org>
   greylistd
   ledstats
   lirc (U)
   tetrinetx
   tleds

Debian GNUstep maintainers <pkg-gnustep-maintainers@lists.alioth.debian.org>
   gnustep-base

Debian Hamradio Maintainers <debian-hams@lists.debian.org>
   aprsd
   ssbd

Debian Icecast team <pkg-icecast-devel@lists.alioth.debian.org>
   icecast2

Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>
   lvm2

Debian Multimedia Team <debian-multimedia@lists.debian.org>
   das-watchdog

Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>
   nsca

Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
   rtpproxy
   siproxd

Eric Delaunay <delaunay@debian.org>
   scsitools

Bernd Eckenfels <ecki@debian.org>
   net-acct
   transproxy

Robert S. Edmonds <edmonds@debian.org>
   pcaputils

Free Ekanayaka <freee@debian.org>
   das-watchdog (U)

Nick Estes <debian@nickstoys.com>
   upsd

Eric Evans <eevans@sym-link.com>
   resolvconf (U)

Bartosz Fenski <fenio@debian.org>
   specter (U)

Martín Ferrari <martin.ferrari@gmail.com>
   vtun

Agney Lopes Roth Ferraz <agney@debian.org>
   fnfx

Duncan Findlay <duncf@debian.org>
   spamassassin

sean finney <seanius@debian.org>
   nsca (U)

Decklin Foster <decklin@red-bean.com>
   lastfmsubmitd
   mpd

Turbo Fredriksson <turbo@debian.org>
   roxen4

Jochen Friedrich <jochen@scram.de>
   isakmpd
   snmptrapfmt

Peter S Galbraith <psg@debian.org>
   xtide

Radovan Garabik <garabik@melkor.dnp.fmph.uniba.sk>
   serpento

Radovan Garabík <garabik@kassiopeia.juls.savba.sk>
   karrigell
   xtell

Bdale Garbee <bdale@gag.com>
   bind9 (U)
   ipip

Hector Garcia <hector@debian.org>
   lirc (U)
   smail

Matthew Garrett <mjg59@srcf.ucam.org>
   hotkey-setup
   netapplet
   nstx

RISKO Gergely <risko@debian.org>
   shaperd

David Gil <dgil@telefonica.net>
   pads

Daniel Kahn Gillmor <dkg@fifthhorseman.net>
   resolvconf (U)

Filippo Giunchedi <filippo@debian.org>
   dmraid (U)

John Goerzen <jgoerzen@complete.org>
   bacula
   pygopherd

Celso González <celso@bulma.net>
   cpudyn

Matthew Grant <grantma@anathoth.gen.nz>
   netscript-2.4

Debian QA Group <packages@qa.debian.org>
   caudium
   emifreq-applet
   laptop-netconf

Daniel Gubser <guterm@debian.org>
   psad
   uptimed (U)

Guido Guenther <agx@sigxcpu.org>
   smartmontools

Aurélien GÉRÔME <ag@roxor.cx>
   dancer-ircd
   dancer-services

Marc Haber <mh+debian-packages@zugschlus.de>
   ifupdown-scripts-zg2
   resolvconf (U)
   torrus (U)

Pierre Habouzit <madcoder@debian.org>
   whitelister

Pascal Hakim <pasc@debian.org>
   anacron

Chris Halls <halls@debian.org>
   apt-proxy

Chris Hanson <cph@debian.org>
   tpconfig (U)

David B. Harris <dbharris@debian.org>
   ipband

Eric Heintzmann <eric@gnustep.fr.st>
   gnustep-base (U)

Andres Seco Hernandez <AndresSH@debian.org>
   alamin

Robert D. Hilliard <hilliard@debian.org>
   dictd (U)

Kirk Hilliard <kirk@debian.org>
   dictd

Varun Hiremath <varunhiremath@gmail.com>
   oss-preserve

Henrique de Moraes Holschuh <hmh@debian.org>
   fcron
   rng-tools

Thomas Hood <jdthood@yahoo.co.uk>
   resolvconf (U)

Simon Horman <horms@debian.org>
   heartbeat
   perdition

Peter Howard <pjh@northern-ridge.com.au>
   zoneminder

Qingning Huo <qhuo@mayhq.co.uk>
   log2mail

Alberto Gonzalez Iniesta <agi@inittab.org>
   fwlogwatch
   netkit-bootparamd
   xmbmon

Mario Iseli <admin@marioiseli.com>
   irmp3

Ian Jackson <ian@chiark.greenend.org.uk>
   sauce

Ian Jackson <ian@davenant.greenend.org.uk>
   userv

Jan Janak <jan@iptel.org>
   rtpproxy (U)

LENART Janos <ocsi@debian.org>
   jmon

Aurelien Jarno <aurel32@debian.org>
   lirc (U)

Joerg Jaspert <joerg@debian.org>
   muddleftpd

LaMont Jones <lamont@debian.org>
   bind9
   hpsockd

Karl E. Jorgensen <karl@jorgensen.com>
   battery-stats

Takuo KITAME <kitame@debian.org>
   smtpguard

Bastian Kleineidam <calvin@debian.org>
   fiaif

Matthias Klose <doko@debian.org>
   buildbot
   isdnutils (U)

Achilleas Kotsis <achille@debian.gr>
   ulogd

Steve Kowalik <stevenk@debian.org>
   xringd

Antonin Kral <A.Kral@sh.cvut.cz>
   pimd

Kilian Krause <kilian@debian.org>
   rtpproxy (U)
   siproxd (U)

Anand Kumria <wildfire@progsoc.org>
   tspc

Oliver Kurth <oku@debian.org>
   masqmail

Joshua Kwan <joshk@triplehelix.org>
   nethack

Mario Lang <mlang@debian.org>
   filterproxy

Thomas Lange <lange@debian.org>
   fai

Simon Law <sfllaw@debian.org>
   wvstreams

Chris Lawrence <lawrencc@debian.org>
   gnome-lokkit

Faidon Liambotis <paravoid@debian.org>
   ulogd (U)

John Lines <john@paladin.demon.co.uk>
   plptools
   smtpd

lirc Maintainer Team <pkg-lirc-maint@lists.alioth.debian.org>
   lirc

Pablo Lorenzzoni <spectra@debian.org>
   tcpspy

Francesco Paolo Lovergine <frankie@debian.org>
   proftpd-dfsg

Ola Lundqvist <opal@debian.org>
   dhttpd
   ledcontrol
   nfsbooted
   ntop

Ian Maclaine-cross <iml@debian.org>
   ddns3-client

Keita Maehara <maehara@debian.org>
   freewnn

Aigars Mahinovs <aigarius@debian.org>
   swapd

Peter Makholm <peter@makholm.net>
   slashem

Santiago Garcia Mantinan <manty@debian.org>
   siproxd (U)

Christoph Martin <christoph.martin@uni-mainz.de>
   mimedefang

Peter Mathiasson <peterm@debian.org>
   pam-devperm

Martin Maurer <fireflier@gibraltar.at>
   fireflier

Brian May <bam@snoopy.debian.net>
   heimdal

Thom May <thom@debian.org>
   puppet (U)

Rene Mayrhofer <rene.mayrhofer@gibraltar.at>
   gibraltar-bootcd

Rene Mayrhofer <rmayr@debian.org>
   pptpd

Jonathan McDowell <noodles@earth.li>
   l2tpns

Neil McGovern <neilm@debian.org>
   blootbot

Steve McIntyre <93sam@debian.org>
   nas
   wmaloader

Kyle McMartin <kyle@ubuntu.com>
   irqbalance

Michael Mende <debian@menole.net>
   wackamole

Abraham vd Merwe <abz@debian.org>
   ixbiff

Michael Meskes <meskes@debian.org>
   jftpgw

Millis Miller <millis@faztek.org>
   iptotal

Loic Minier <lool@dooz.org>
   dmraid (U)
   lirc (U)
   termpkg

Andrew Mitchell <ajmitch@debian.org>
   gnue-appserver

Hamish Moffatt <hamish@debian.org>
   aprsd (U)
   ssbd (U)

lantz moore <lmoore@debian.org>
   rplay

Sam Morris <sam@robots.org.uk>
   pymsnt

James Morrison <phython@debian.org>
   wvstreams (U)

Jose M. Moya <josem@debian.org>
   mathopd

Sven Mueller <sven@debian.org>
   lirc (U)

Ryan Murray <rmurray@debian.org>
   at

Sebastian Muszynski <do2ksm@linkt.de>
   ax25spyd

Gergely Nagy <algernon@debian.org>
   tama

Marco Nenciarini <mnencia@debian.org>
   resolvconf (U)
   xtradius

Jaakko Niemi <liiwi@debian.org>
   sfs

Recai Oktaş <roktas@debian.org>
   elog

Masahito Omote <omote@debian.org>
   totd

Patrick Ouellette <pouelle@debian.org>
   aprsd (U)
   ssbd (U)

Sam Hocevar (Debian packages) <sam+deb@zoy.org>
   gnudip
   ipfm
   rinetd

Gerrit Pape <pape@smarden.org>
   cfs
   dropbear

Eloy A. Paris <peloy@debian.org>
   ipxripd
   ncpfs

Patrick Patterson <ppatters@debian.org>
   wvstreams (U)

Javier Fernandez-Sanguino Pen~a <jfs@debian.org>
   bastille
   nessus-core

Javier Fernandez-Sanguino Pen~a <jfs@computer.org>
   honeyd
   pads (U)
   samhain

Víctor Pérez Pereira <vperez@debianvenezuela.org>
   squidtaild

Nick Phillips <nwp@lemon-computing.com>
   teapop

Ari Pollak <ari@debian.org>
   drscheme

Cajus Pollmeier <cajus@debian.org>
   nsca (U)
   uif

Daniel J. Priem <danielpriem@flexserv.de>
   capisuite

Celso Providelo <cprov@gwyddion.com>
   sqcwa

Puppet Package Maintainers <pkg-puppet-devel@lists.alioth.debian.org>
   puppet

Mark Purcell <msp@debian.org>
   gsmlib
   hpoj
   rtpproxy (U)
   siproxd (U)

KELEMEN Péter <fuji@debian.org>
   arpwatch

Stephen Quinney <sjq@debian.org>
   ganglia-monitor-core (U)

Martin Quinson <mquinson@debian.org>
   nws

Ganesan Rajagopal <rganesan@debian.org>
   ipsec-tools
   openslp-dfsg

Simon Raven <simon@nuit.ca>
   blootbot (U)

resolvconf maintainers <resolvconf-devel@lists.alioth.debian.org>
   resolvconf

Sebastian Rittau <srittau@debian.org>
   netatalk (U)

Jaime Robles <jaime@debian.org>
   aprsd (U)
   ssbd (U)

Kurt Roeckx <kurt@roeckx.be>
   ircd-irc2
   openntpd

Piotr Roszatycki <dexter@debian.org>
   ldapdns
   systune

Mats Rynge <mats@rynge.net>
   p3scan

Anibal Monsalve Salazar <anibal@debian.org>
   bpalogin
   ncpfs (U)
   pipsecd
   swapspace

Otavio Salvador <otavio@debian.org>
   apt-proxy (U)

Amaya Rodrigo Sastre <amaya@debian.org>
   lirc (U)

Daniel Schepler <schepler@debian.org>
   monopd

Bernd Schumacher <bernd.schumacher@hp.com>
   secvpn

Frederik Schüler <fs@debian.org>
   wackamole (U)

Vladimir Shakhov <lumpen.intellectual@gmail.com>
   wdm

Guus Sliepen <guus@debian.org>
   inputlirc

Paul Slootman <paul@debian.org>
   isdnutils
   isdnutils (U)

Jurij Smakov <jurij@debian.org>
   torrus (U)

Jonas Smedegaard <dr@jones.dk>
   icecast2 (U)
   netatalk
   netatalk (U)
   pop-before-smtp
   rpld

Roger So <rogerso@debian.org>
   im-sdk
   im-sdk (U)

Jose Carlos Garcia Sogo <jsogo@debian.org>
   siproxd (U)

David Spreen <netzwurm@debian.org>
   anon-proxy

Joop Stakenborg <pa3aba@debian.org>
   aprsd (U)
   cwdaemon
   pingpong
   ssbd (U)

Dennis Stampfer <seppy@debian.org>
   timeoutd

Andrew Stribblehill <ads@debian.org>
   ganglia-monitor-core (U)

Stephan A Suerken <absurd@debian.org>
   gom

Ondřej Surý <ondrej@debian.org>
   bird
   nsd
   postfix-policyd

Bryan Sutula <Bryan.Sutula@hp.com>
   openhpi

Matt Taggart <taggart@debian.org>
   cpqarrayd

Akira TAGOH <tagoh@debian.org>
   im-sdk (U)

Sergio Talens-Oliag <sto@debian.org>
   postman

Jose Luis Tallon <jltallon@adv-solutions.net>
   couriergraph

Stuart Teasdale <sdt@debian.org>
   ganglia-monitor-core

Paul Telford <pxt@debian.org>
   mordor
   mudnames

Jason Thomas <jason@debian.org>
   nagios-statd

Michael Tokarev <mjt@corpit.ru>
   rbldnsd

Torrus maintainers <pkg-torrus-maintainers@lists.alioth.debian.org>
   torrus

Junichi Uekawa <dancer@debian.org>
   rarpd

Fumitoshi UKAI <ukai@debian.or.jp>
   hyperestraier
   quickml
   smtpfeed

Matthias Urlichs <smurf@debian.org>
   mgetty (U)

Utnubu Team <utnubu-maintainers@lists.alioth.debian.org>
   dmraid

Thibaut VARENE <varenet@debian.org>
   uptimed

Matej Vela <vela@debian.org>
   vsftpd

Santiago Vila <sanvila@debian.org>
   postfix-gld
   rbldnsd (U)

Tommi Virtanen <tv@debian.org>
   scalemail

Michael Vogt <mvo@debian.org>
   scanlogd

Riku Voipio <riku.voipio@iki.fi>
   setmixer

Martin Waitz <tali@debian.org>
   oidentd

Lucas Wall <lwall@debian.org>
   popfile

Hanna Wallach <hmw26@cam.ac.uk>
   didiwiki

Chad Walstrom <chewie@debian.org>
   clamsmtp

Jerome Warnier <jwarnier@beeznest.net>
   and

Dan Weber <dan@mirrorlynx.com>
   siproxd (U)

Joerg Wendland <joergland@debian.org>
   ipvsadm

Torsten Werner <twerner@debian.org>
   oss-preserve (U)

Brian White <bcwhite@pobox.com>
   genpower
   squid-prefetch

Carsten Wolff <carsten@wolffcarsten.de>
   distcc

Martin Wuertele <maxx@debian.org>
   bopm

Matt Zimmerman <mdz@debian.org>
   umlrun

Anton Zinoviev <zinoviev@debian.org>
   console-cyrillic
}}}
Line 880: Line 155:
CategoryDeveloper ## This page is linked from sysv-rc postinst script
CategoryBootProcess | CategoryDeveloper | CategoryPermalink

Translation(s): none


Dependency based boot sequence

Before Debian 8.0, Debian used init to boot-up the system. This page provide information of the details to resolve the dependency issues. Since Debian 8.0, Systemd replaced init and the dependency was relied on its target files. The information described here no longer applies to Debian's default in Jessie.

Debian was converted to order the boot sequence using the LSB fields in the header of each init.d script. This has removed several bugs in the former boot sequence, and now makes it easier to keep the sequence correct.

Advantages

Did you ever need to insert a init.d scripts Y before init.d scripts Z and after init.d script X, where both Z and X is started using boot sequence number 20 (as in 20X and 20Z)? Adding your script as 20Y would not cut it, because you need Z to start before X. To do this, in Debian you currently need to talk to the maintainer of packages with scripts Z and X, asking one of them (or both) to move their script into a different number. Dependency based boot sequencing make it possible for each package maintainer to specify the dependencies of its scripts, and leave the number allocation to the dependency resolver.

Some examples of such problems are 256699 294053, 279297, 311057 and 475626 .

How to add a service when using dependency-based booting

In Debian releases prior to 6.0, a service could be added with update-rc.d:

update-rc.d mydaemon defaults

Starting with Debian 6.0, the insserv command is used instead, if dependency-based booting is enabled:

insserv mydaemon

Where mydaemon is an executable init script placed in /etc/init.d. insserv will produce no output if everything went OK. Examine the error code in $? if you want to be sure.

Both the old and the new way requires an init script to be present in /etc/init.d. For dependency-based booting, the script needs to be an LSB init script.

As of Debian 7 man insserv states

  • insserv is a low level tool used by update-rc.d which enables an installed system init script (`boot script') by reading the comment header of the script

so you need not use it instead of update-rc.d - see your local manpage for details.

History of the feature

The feature was proposed at debconf in 2002, and has been worked on since before 2006, and was announced on debian-devel-announce 2008-01-17. A status update message was sent 2008-03-16 and 2008-11-30. The default in Debian was changed to dependency based boot sequencing 2009-07-27, and an updated announcement about the plans for the boot system was sent out 2009-09-05. The default in Debian was changed to run scripts in parallel 2010-05-14 and an announcement was sent on 2010-05-21.

Status

This page was created to keep track of the state of this feature, to make it easier to coordinate an effort to implement it in Debian. It was proposed as a release goal for Lenny. It will be the default boot ordering method for Squeeze. During Debconf in 2009, the default in Sid was changed to use dependency based boot sequencing by default.

A number of bug reports are submitted to request LSB fields in init.d scripts. It is useful to track the ones open in testing as well.

A daily updated archive wide check of init.d scripts is available from http://lintian.debian.org/~pere/ . Piuparts now reports installation errors due to incorrect dependencies, and inconsistencies between update-rc.d calls and LSB fields.

Plan of migration

This is a proposal for a plan to migrate all of Debian over to dependency based boot sequencing.

  1. Change the debconf default in insserv to enable dependency based boot sequencing when the package is installed, if it is safe to do so. Show the question again on upgrades if the conversion isn’t done yet. Remove/disable the option to disable insserv after it is enabled.

  2. Change sysv-rc to depend on insserv, to pull it in on all (non-file-rc) installations.

  3. Wait 6 months, while rewriting policy text to document the new way update-rc.d is going to work.

  4. Drop support for specifying sequence numbers in update-rc.d.

This will enable dependency based boot sequencing for all in Debian from Squeeze and onwards.

How to solve migration problems

package X removed but not purged

If a script in /etc/init.d/ belongs to a package that is removed but not purged, the field is probably missing or is outdated. Purging the package will solve the issue.

package X left obsolete init.d script behind

The script was probably dropped from its package, but the package maintainer forgot to add code in the postinst to remove the obsolete script during upgrades. Removing the script is probably the correct solution. We have seen one report where dpkg would claim that a script was obsolete one time and not obsolete one upgrade later, so this should probably be checked a bit before the script is removed.

To verify that a package really left behind obsolete conffiles, one can run

dpkg-query -W -f='${Conffiles}\n' packagename | grep obsolete

There are several reasons why these scripts are not removed automatically during upgrades. First of all, reporting these issues exposes bugs that should be fixed in the individual packages. Second, it is hard to know if the script reported was left behind for a strange and particular reason, or just forgotten. And last, there is the one report that a non-obsolete script was reported as obsolete. Still not sure if that was for real or not, but until we know the reason, it seemed risky to just remove scripts in other packages during upgrades. Besides doing so from the sysv-rc postinst would be a policy violation.

insserv: warning: script 'X' missing LSB tags and overrides

The /etc/init.d/X script is lacking the LSB fields. Adding them to the script header or as a override file in /etc/insserv/overrides/X would solve it.

insserv: script X: service Y already provided!

Bug in the package with script X: The facility provided in script /etc/init.d/X uses a non-unique value. Changing it to a unique value (for example the script name without .sh ending), solves the issue.

Common problems with init.d script header LSB fields

Here are some problems I have seen with the LSB fields in init.d scripts during the last three years. I provide it here for those of you wondering if your package’s init.d scripts are correct.

  1. Non-unique Provides field
    • When two packages have scripts with the same Provides field, it will only be able to install these packages if the init.d script of the other is not present in /etc/init.d/. Packages sharing a common service with other packages could use virtual facilities instead of conflicting provides, or normal dependencies if few packages are involved.

  2. Incorrect runlevel list
    • If the Default-Start and Default-Stop fields do not list the runlevels where a script should be stopped or started, the wrong set of start and stop symlinks will be created when the script is installed, and the boot and shutdown sequence will most likely be incorrect. Fixing it require both updates to the fields, and code in the postinst script to add or remove symlinks that where missing.
  3. Missing dependency on $syslog when logging to syslog

    • Without it, services might be started too early during boot and some syslog messages might be lost.
  4. Missing dependency on $remote_fs when needing files in /usr/.

    • Scripts starting from rcS.d/ will start too early when /usr/ is on NFS, and will probably fail to work because some of its expected files and programs are missing when the script starts.

  5. Depending on incorrect or non-existing provides
    • The intended relationship with another script does not take effect, making the script run too early or too late during boot and shutdown.

To see the boot and reboot sequence dependency graph, use

aptitude install insserv graphviz
/usr/share/insserv/check-initd-order -g > boot.dot
/usr/share/insserv/check-initd-order -g -k > reboot.dot
dotty boot.dot
dotty reboot.dot

The list of packages whose init.d script is lacking an LSB header can be fetched from the lintian reports for the init.d-script-missing-lsb-section tag.

To enable dependency based boot, insserv can be used. At debconf7 and FOSDEM 2008 (video), Petter Reinholdtsen gave a talk about the dependency based boot system. To enable it in older versions of Debian, install insserv and activate it like this:

aptitude install insserv && dpkg-reconfigure insserv sysv-rc

Make sure to use insserv version 1.09.0-6 or higher.

To usertag related bugs, send an email to request (at) bugs.debian.org, with content like this:

user initscripts-ng-devel (at) lists.alioth.debian.org
usertag 361054 + incorrect-dependency
usertag 361358 + missing-dependency
thanks


CategoryBootProcess | CategoryDeveloper | CategoryPermalink