[systemd-devel] reboot on emergency.target

Lennart Poettering lennart at poettering.net
Tue Apr 7 11:09:30 UTC 2020


On Di, 07.04.20 11:26, Matwey V. Kornilov (matwey.kornilov at gmail.com) wrote:

> Hi,
>
> I would like my system to reboot (with some cool down timeout) on
> emergency.target instead of running the emergency shell. What would be
> the recommended way to achieve this behavior? Is it ok just to override
> default emergency.service to whatever I want?

Just override emergency.service in /etc/systemd/system/ with a service
of your own, that sleeps and then issues "systemctl reboot".

You could also just mask the service and pull in a different service
instead. Or you could mask it + pull in reboot.target as a dependency
from emergency.target via a .wants/ symlink (but then you woudln't get
your cool down timout).

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list