On Wed, Jul 6, 2016 at 1:50 PM Martin Pitt <martin.p...@ubuntu.com> wrote:
> Martin Pitt [2016-07-06 13:47 +0200]: > > I have a gut feeling that this should be expressible with systemd > > dependencies -- i. e. "if gnome-session.service stops, then stop > > gnome-session.target". Naïvely this would be > > "PartOf=gnome-session.target" in gnome-session.service, but this does > > not currently work (that might be the same bug I mentioned in my other > > reply). > > Sorry, wrong way around according to how PartOf= works: I meant > "PartOf=gnome-session.service" in gnome-session.target. (But that > doesn't work either). > Note that systemd makes a difference between "gnome-session.service became inactive" and "gnome-session.service gets stopped". A service terminating by itself is the former. Requires= and PartOf= will only propagate the latter. BindsTo= also stops on the former (besides acting like Requires=). So, if gnome-session.target BindsTo=gnome-session.service, gnome-session.target requires gnome-session.service and will be stopped when the service exits. There's also StopWhenUnneeded=, which might useful on the targets.
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel