[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

When the init.d script exist, the service should be operational

During my work on dependency based boot sequencing and parallel
booting, I have ran across bugs in packages exposed by the new boot
ordering, and thought it best to mention it here.

The SysV boot system runs init.d scripts in sequence with the
assumption that when a script exits, its service is operational.
Based on this assumption, it is then safe to start new services that
the depend on the already started service and expect them to find the
services they need.  This means that init.d scripts should not exit at
boot before the service they start is operational, and in the common
case, this mean service daemons should have loaded their configuration
and started listening on their sockets before the init.d script ends.

This is not the case with some of the services in Debian, and this
causes race conditions in the boot.  Two bugs are reported already for
pdns (#585966) and slapd (#589915), but I expect there to be more of
these problems.

These bugs are easier to expose with parallel booting based on
dependencies, but was also present earlier with the static boot
ordering.  Some of them were hidden by chance, thanks to the slow
boot, but are now exposed because the boot happen faster than before.

If you maintain a package with a service started during boot using a
init.d script, please make sure your service is operational when the
init.d script exits.

Happy hacking,
Petter Reinholdtsen

Reply to: