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

Jon Severinsson jon at severinsson.net
Fri Feb 14 14:59:13 GMT 2014


Hi Michael 

> 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)?

Actually, the problematic init script on the Tanglu live-cd is a package with 
"Required-Start: $networking", not "Required-Start: $remote_fs". And it 
actually has to run after the networking sysv init script (which still handles 
/etc/network/interfaces), even though it does not necessarily have to run 
after NetworkManager.service, which indeed is what causes network.target to 
(indirectly) Require= sysinit.target

> > 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.

Together with a patch adding DefaultDependencies=no to NetworkManager.service 
(making it run after sysinit.d and dbus.socket but before, or parallel to, 
basic.target, but after sysinit.target and dbus.socket) it does break the 
cyclic dependency, which solves at least this particular problem.

And while I see obvious issues with not special-casing rcS.d scripts further 
than the adding of DefaultDependencies=no done by upstream, I can't see why 
using basic.target instead of sysinit.target would break anything. All normal 
init scripts, both native service files and non-rcS.d sysv init scripts, 
already depends on it, by virtue of the default DefaultDependencies=yes.

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

Obviously, and not likely to happen before the release of Tanglu 1 
("aequorea"), planed for next week, and probably not even for Debian 8 
("jessie"), not to mention third party init scripts (though hopefully there 
isn't a whole lot of those in rcS.d).

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

In addition to breaking the, presumably rare but valid, case of a script 
actually needing $remote_fs, it will not solve the problem, as $network will 
still case breakage.

I guess that additionally using networking.service instead of network.target 
for $network could work, but I feel that such a solution would be both more 
complex and more brittle than using basic.service instead of sysinit.service.

> Jon, do you want to work on such a patch?

Such a patch would be a bit more difficult, as we would want to make the changes 
only for rcS.d scripts, not regular sysv init scripts, but if you still are  
convinced not to go with my simpler aproach I'm willing to give it a try.

Regards
Jon Severinsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20140214/7bcddf08/attachment-0005.sig>


More information about the Pkg-systemd-maintainers mailing list