[systemd-devel] Potential major bug in 214

Adam Williamson awilliam at redhat.com
Wed Jun 25 15:23:44 PDT 2014


On Thu, 2014-06-26 at 00:01 +0200, Michael Biebl wrote:
> >
> > If there are any SysV initscripts in /etc/init.d that have:
> >
> > # Provides: $network
> 
> That should translate to
> Wants=network.target
> Before=network.target
> 
> i.e., the service is provider for network.target. network.target
> itself is a passive unit.

This particular case is somewhat different from the Should-Start and
Required-Start cases, I think. We should probably consider it
separately. In Fedora, I believe it only affects /etc/init.d/network ,
which winds up being wanted by network-online.target , which means it
gets run even if NetworkManager is enabled. Which *does* seem wrong, but
definitely not the same as the other case. It might even be best to
split it into a different bug report.

> 
> >
> > or:
> >
> > # Should-Start: $network
> 
> IIRC with the old sysv support that simply translated to
> 
> After=network.target. No Wants or Requires dependencies.
> 
> 
> > or:
> >
> > # Required-Start: $network
> 
> Same here. That simply translated to
> After=network.target

So, I believe the sysv-generator code is basically *intended* to do
what's advised in 'man systemd.special':

       network-online.target
           Units that strictly require a configured network connection should
           pull in network-online.target (via a Wants= type dependency) and
           order themselves after it. This target unit is intended to pull in
           a service that delays further execution until the network is
           sufficiently set up.

i.e. if sysv service "foo" depends on $network, it wants to make the
translated "foo.service" unit Want network-online.target (and be ordered
After it - that part it gets right already). The problem I identified is
that it gets this backwards, and winds up making network-online.target
Want the service "foo.service".

You're questioning whether the generator's *intended* behaviour is the
*optimal* behaviour, or whether the behaviour of the equivalent code in
prior systemd versions was better. That seems like a slightly separate
question. In answering it, the issue would be whether LSB's $network
concept more closely matches systemd's network-online.target concept or
its network.target concept. The LSB doc is
http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/facilname.html , and it says:

$network	 	
	basic networking support is available. Example: a server program could
listen on a socket.

So...discuss, I guess? I'm not going to venture an opinion. I'd say the
highest priority thing here is that the current behaviour doesn't even
seem to match the *intended* behaviour. But I guess if you were to
decide that the generator's intention is wrong too and it should just do
what the old systemd code did - After=network.target - then you could go
straight from the current behaviour to that, and not worry about how to
fix the code to do what it's currently trying to do...
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net



More information about the systemd-devel mailing list