[systemd-devel] A way to debug machine shutdown

Lennart Poettering lennart at poettering.net
Wed May 6 14:59:47 UTC 2020


On So, 26.04.20 19:08, Dark Penguin (darkpenguin at yandex.com) wrote:

> Very often I have encountered one problem: during shutdown, systemd has
> to wait for something. Of course, it is probably different things every
> time, and it is probably not systemd's fault, at least some of the cases.
>
> This leads to the question: how do we find out the root of the problem?
> Systemd has a lot of good tools for debugging, but using them is not as
> easy as it seems, and the Internet is not much help either.
>
> Naturally, reading the output and the journal would be the first step.
> On the screen, it was "A stop job is running for session 1 of user
> myuser". In the journal, there is:
>
> Apr 26 18:46:56 DEUS systemd[1]: session-1.scope: Stopping timed out.
> Killing.
> Apr 26 18:46:56 DEUS systemd[1]: session-1.scope: Failed with result
> 'timeout'.
> Apr 26 18:46:56 DEUS systemd[1]: Stopped Session 1 of user myuser.
> Apr 26 18:46:56 DEUS systemd[1]: Stopping Login Service...
> Apr 26 18:46:56 DEUS systemd[1]: Stopping User Manager for UID 1000...
> Apr 26 18:46:56 DEUS systemd-logind[809]: Removed session 1.
>
> Now how do I check exactly what was the problem in that session?

Which systemd version is this?

Current versions (since ~231 iirc) of systemd log about the processes
they kill due to timeouts. You should find that in the logs.

There's also:

https://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list