[systemd-devel] Standardizing names for graphical session units

Jan Alexander Steffens jan.steffens at gmail.com
Wed Jul 6 11:57:51 UTC 2016


On Wed, Jul 6, 2016 at 1:50 PM Martin Pitt <martin.pitt at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160706/6c2b61eb/attachment-0001.html>


More information about the systemd-devel mailing list