[systemd-devel] Conflation of propagation in dependencies creates race windows

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Jan 19 16:58:11 UTC 2019


On Sat, 2019-01-19 at 15:54 +0000, Jonathon Kowalski wrote:
> https://github.com/systemd/systemd/issues/1154 which is similar in
> nature convinces me that systemd currently conflates two many
> properties in the same dependency. The second bug in particular would
> not happen if there was a version of Requires= that disabled the
> PartOf= stuff it currently has, i.e., pick and choose deps.

I think you're wrong here. It makes perfect sense that if unit A has
Requires= for another unit, stopping that required unit which A can't
work without will stop A too. Removing that logic is not a good
solution.

So the case is:

Service X has StopWhenUnneeded=true
Service Y has Requires=X, Restart=always

and the problem is that Y dying can in some circumstances stop X (due
to it being "unneeded" when Y is not actively running), and then
running this stop action on X stops Y completely too (so it will not
restart later), as if the administrator had explicitly stopped X.

I think the ideal behavior here is that X would never be stopped at all
if Y is scheduled to be restarted. Changes that would keep Y running
even if the administrator explicitly runs "systemctl stop X" would
definitely be wrong.




More information about the systemd-devel mailing list