[systemd-devel] StopWhenUnneeded=yes/PropagatesStopTo= unless unit was started manually
Philippe Cerfon
philcerf at gmail.com
Sun Mar 16 19:38:17 UTC 2025
Hey.
I have a unit foo which depends on a .mount unit.
What I would like to have was, that if foo is stopped, the .mount is
stopped, too, but only if it wasn't started/mounted manually.
If I use StopWhenUnneeded=true in the .mount, then mounting it
manually doesn't work anymore (well it gets immediately unmounted
again, unless e.g. foo is running), so that doesn't really work.
If I use PropagatesStopTo=my.mount in foo, then it works a bit better,
I can manually mount it, it gets stopped when foo is stopped, but also
if I actually mounted it manually (unless of course it's somehow
locked).
Is there some way to realise the above? Not really super important, I
just got curious.
Thanks,
Philippe.
More information about the systemd-devel
mailing list