I'm mainly asking because I fail to make certain services stop in a certain order at reboot/shutdown. Hmm, maybe I should focus on starting them in a certain order? then maybe shutdown will do it in reverse order, rather then seemingly all at once.
> Marcus Linsner:
> > I'm mainly asking because I fail to make certain services stop in a
> > certain order at reboot/shutdown. Hmm, maybe I should focus on
> > starting them in a certain order? then maybe shutdown will do it in
> > reverse order [...]
>
> Yes, that's how systemd does it. See Before= and After= in the
> systemd.unit manpage.
I know it seems simple, and yet in practice it doesn't work (or rather, sometimes it works, mostly it doesn't).
For example: In dom0, I added `udisks2.service` on the `After=` line of `qubes-core.service` (did do the required `sudo systemctl daemon-reload` - looks like `sudo` isn't required, thanks to passwordless sudo I suppose) then I the next reboot (from xfce Menu->Logout->Restart) seems to have worked in the sense that there were no more timeouts reported on the log, then the next reboot the timeouts were back. Seen here: https://gist.github.com/constantoverride/61207ebf622263d25fb1e5b1f11d0148/9443ef0babe29b32622dd0f17a2435a9e0f1df92#gistcomment-2696596
Another example, instead of `udisks2.service` I added `dev-block-253:0.device` on the `After=` line of `qubes-core.service`, then the next TWO reboots were fine!(aka no `timed out` or `timeout` reported, but on the third reboot the timeouts were back, without me changing anything.
All of that seen here: https://gist.github.com/constantoverride/61207ebf622263d25fb1e5b1f11d0148/9443ef0babe29b32622dd0f17a2435a9e0f1df92#gistcomment-2696607
(the contents of `qubes-core.service` can be seen one or two pages above the linked comment; the actual log of the reboots are linked to in the comment)
Maybe it's a systemd bug? but since dom0 is stuck with Fedora 25 (as opposed to Fedora 28), then I cannot get it upgraded, I believe.
Another example, I even tried replacing `dev-block-253:0.device` with `system.device` (later with `system.device systemd.device`) but there were no reboots (so far) that didn't time out.
Anyway, the point is: I don't know how to make use of systemd so that this stalling doesn't happen on reboot/shutdown https://github.com/QubesOS/qubes-issues/issues/1581#issuecomment-417968474
:)