[systemd-devel] Is there a way to recover from a crashed systemd without rebooting?

Lennart Poettering lennart at poettering.net
Wed Nov 1 07:55:09 UTC 2017


On Di, 31.10.17 17:04, Daniel Wang (wonderfly at google.com) wrote:

> I hit a bug in systemd-232 and it crashed. Anything I tried to do with
> `systemctl`, including `systemctl daemon-reexec` seemed to rely on the
> systemd dbus service, which all resulted in `Failed to activate service
> 'org.freedesktop.systemd1': timed out`.
> 
> systemd runs as PID 1. Is there any way to recover without a reboot?

When PID 1 crashes by a signal this is caught and PID 1 will freeze,
but first close all file descriptors. This normally means that you
cannot contact it anymore, but you should get immediate failure
replies about any attempts as all communication channels are
terminated and not left hanging.

I wished we could make PID 1 recover fully on such crashes, i.e. by
execing ourselves again on failure signal, however the last time I
looked (which was when we started working on systemd) the kernel
doesn't actually allows reexecing PID 1 anymore after it caught a
deadly signal once...

Long story short: no you cannot recover from PID 1 crashing. Sorry!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list