]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: let user define start-/stop-timeout behaviour
authorJan Klötzke <Jan.Kloetzke@preh.de>
Tue, 16 Apr 2019 14:45:20 +0000 (16:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 9 Jun 2020 08:04:57 +0000 (10:04 +0200)
commitbf760801804e55b045aed54bf9b1d0b0131be3f2
tree4acadce5c9448df43d80753ee182ca3cb4d44ad9
parent8b5616fa913bf475d0bcec771ae0722b7a20c5e9
core: let user define start-/stop-timeout behaviour

The usual behaviour when a timeout expires is to terminate/kill the
service. This is what user usually want in production systems. To debug
services that fail to start/stop (especially sporadic failures) it
might be necessary to trigger the watchdog machinery and write core
dumps, though. Likewise, it is usually just a waste of time to
gracefully stop a stuck service. Instead it might save time to go
directly into kill mode.

This commit adds two new options to services: TimeoutStartFailureMode=
and TimeoutStopFailureMode=. Both take the same values and tweak the
behavior of systemd when a start/stop timeout expires:

 * 'terminate': is the default behaviour as it has always been,
 * 'abort': triggers the watchdog machinery and will send SIGABRT
   (unless WatchdogSignal was changed) and
 * 'kill' will directly send SIGKILL.

To handle the stop failure mode in stop-post state too a new
final-watchdog state needs to be introduced.
man/systemd.service.xml
src/basic/unit-def.c
src/basic/unit-def.h
src/core/dbus-service.c
src/core/load-fragment-gperf.gperf.m4
src/core/load-fragment.c
src/core/load-fragment.h
src/core/service.c
src/core/service.h
src/shared/bus-unit-util.c