<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - systemctl poweroff/reboot does not bring down user services respectfully"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=77416#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - systemctl poweroff/reboot does not bring down user services respectfully"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=77416">bug 77416</a>
              from <span class="vcard"><a class="email" href="mailto:vimregisters@gmail.com" title="vimregisters@gmail.com">vimregisters@gmail.com</a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=77416#c2">comment #2</a>)
<span class="quote">> The X11 libs kill processes hard if the connection is severed. THis is most
> likely what you experienced, and is out of systemd's hands. If you order
> things properly against X11 however, and make sure that X11 is terminated
> only after chrome then the X11 libs will not see the connectiosn terminated,
> and thus is the correct fix for the issue. Closing hence.</span >

It is kind of strange though. It now mostly works,
but still sometimes fails. I spoke too soon in my
last comment.

There's lots of strangeness going on with my
setup. I'm sure I have things ordered correctly,
and things mostly work, but occasionally things
are as they were before, and there are
occassional startup problems.

I'll do a 'systemctl --user start graphical.target
+some_other_gui_stuff' and X isn't started
correctly, but the GUI stuff are running and
active according to systemctl, which makes no
sense.

But back to the original problem


I've read the systemd documentation and looked
through some unit files in /usr/lib~, so I'm pretty
confident I have the dependency stuff figured out
(enough). 

X has:
Wants=x11.target
Before=x11.target
WantedBy=graphical.target

GUI stuff (including chrome) have:
Requires=x11.target
After=x11.target

So the startup order should be:
X
x11.target
gui stuff

Then at shutdown or deactivation, the Before and
After are reversed, so the units deactivate in
this order:
gui stuff
x11.target
X

The order should be correct, so Chrome shouldn't
be killed by X since X wouldn't even think about
shutting down until Chrome is gone. Is it because
Chrome takes too long to deactivate? Because it
_does_ spend a good while writing a bunch of stuff
to disk. I'm hesitant to add any sleeps or
timeouts to fix my startup/shutdown issues. If
there are any flaws in my Before/After config,
someone please let me know.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>