[Pkg-systemd-maintainers] Bug#738965: systemd: Circular dependencies caused by Debian specific handling of runlevel S sysv init scripts.

Michael Biebl biebl at debian.org
Fri Feb 14 13:39:42 GMT 2014


Hi Jon,

Am 14.02.2014 11:31, schrieb Jon Severinsson:
> The debian/patches/debian-changes patch add, amongst other things,
> code to make any sysv init script with Default-Start: S gain
> WantedBy=sysinit.target and Before=sysinit.target.
> 
> However, upstream systemd already contains code to map any
> Required-Start: $network into After=network.target and any
> Required-Start: $remote_fs into After=remote-fs.target.
> Unfortunately, both network.target and remote-fs.target are
> typically started after sysinit.target, and in many cases
> (indirectly) Require=sysinit.target.


It's correct that the handling of rcS style init scripts is a Debian
specific patch. Upstream has removed this functionality under the
assumption that the early boot stage should be handled by native service
files only. We aren't quite there yet in Debian, there are still 100+
packages shipping SysV init scripts in rcS.

> This causes a cyclic dependency, which systemd tries to resolve
> by removing, essentially at random, or more of the involved units
> from the transaction. On one particular system of mine, this
> reliably turns out to be dbus.socket, without which the system
> becomes more-or-less unusable.

I assume you have a SysV init script in rcS which has
Required-Start: $remote_fs
and the network.target is enabled and active (most likely pulled in by
NetworkManager)?


> To solve this problem, while still making sure runlevel S sysv init
> scripts are run before runlevel 2, 3, 4 and 5 sysv init scripts, I
> would recommend changeing sysinit.target to basic.target. This would
> not completely solve the problem, as network.target might (indirectly)
> Require=basic.target as well, but it would mitigate it significantly
> (as dbus.socket is no longer involved in the cycle), and makes it
> possible to completely eliminate the cycle by changeing the network
> providers (in this case NetworkManager.service) to not depend on
> basic.target. (Note that it is not possible to change NetworkManger
> to not depend on sysinit.target, as it requires dbus.socket for basic
> operatation, and dbus.socket Requires=sysinit.target).
> 
> Attaching a one-line patch that would solve the systemd part of this
> problem by replacing SPECIAL_SYSINIT_TARGET with SPECIAL_BASIC_TARGET
> at line 4072 in debian/patches/debian-changes. I will follow up with
> a patch to NetworkManager as a separate bug report later.

I vaguely remember that we discussed this issue a while ago and I'm not
convinced your patch actually addresses the issue properly.

In an ideal world, we'd simply convert all rcS SysV init scripts to
native .service files. This will take time though.

My proposal for the meantime would be to replace the $remote_fs
dependency for rcS style SysV init scripts with $local_fs.

Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20140214/d61fcc39/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list