[systemd-devel] How to find out the processes systemd-shutdown is waiting for?

Manuel Wagesreither ManWag at FastMail.FM
Tue Mar 8 15:20:57 UTC 2022


Hi all,

Am Do, 3. Mär 2022, um 19:02, schrieb Lennart Poettering:
> On Mi, 02.03.22 17:50, Lennart Poettering (lennart at poettering.net) wrote:
>
>> That said, we could certainly show both the comm field and the PID of
>> the offending processes. I am prepping a patch for that.
>
> See: https://github.com/systemd/systemd/pull/22655
>
> Lennart

now that is some service. Thanks for looking into this that quickly!

I think we solved our issues, and it seems they were not related to docker at all. The mistake was on our side.

We were using the PowerOff() method from org.freedesktop.systemd1.Manager [1], which the manpage advices against. When using PowerOff() from org.freedesktop.login1.Manager, which as per the manpage is the preferred way to trigger a shutdown from GUI, things seem to work okay.

That is, this shows the described issues:
```
dbus-send --system --print-reply --type='method_call' --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.PowerOff
```
while this works ok:
```
dbus-send --system --print-reply --type='method_call' --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.PowerOff boolean:false
```

[1] https://www.freedesktop.org/software/systemd/man/org.freedesktop.systemd1.html#Methods
[2] https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html#Methods

Posting this here as it might be of interest to someone on the list.

Best regards,
Manuel


More information about the systemd-devel mailing list