<div dir="ltr">On Wed, Jul 6, 2016 at 1:50 PM Martin Pitt <<a href="mailto:martin.pitt@ubuntu.com">martin.pitt@ubuntu.com</a>> wrote:<br><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Martin Pitt [2016-07-06 13:47 +0200]:<br>
> I have a gut feeling that this should be expressible with systemd<br>
> dependencies -- i. e. "if gnome-session.service stops, then stop<br>
> gnome-session.target". Naïvely this would be<br>
> "PartOf=gnome-session.target" in gnome-session.service, but this does<br>
> not currently work (that might be the same bug I mentioned in my other<br>
> reply).<br>
<br>
Sorry, wrong way around according to how PartOf= works: I meant<br>
"PartOf=gnome-session.service" in gnome-session.target. (But that<br>
doesn't work either).<br></blockquote><div><br></div><div>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.<br><br>Requires= and PartOf= will only propagate the latter. BindsTo= also stops on the former (besides acting like Requires=).<br><br></div><div>So, if gnome-session.target BindsTo=gnome-session.service, gnome-session.target requires gnome-session.service and will be stopped when the service exits.<br></div><div><br></div><div>There's also StopWhenUnneeded=, which might useful on the targets.<br></div></div></div></div>