diff options
author | Jan Klötzke <Jan.Kloetzke@preh.de> | 2019-04-16 16:45:20 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-06-09 10:04:57 +0200 |
commit | bf760801804e55b045aed54bf9b1d0b0131be3f2 (patch) | |
tree | 4acadce5c9448df43d80753ee182ca3cb4d44ad9 /src/basic/unit-def.c | |
parent | 8b5616fa913bf475d0bcec771ae0722b7a20c5e9 (diff) | |
download | systemd-bf760801804e55b045aed54bf9b1d0b0131be3f2.tar.gz |
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.
Diffstat (limited to 'src/basic/unit-def.c')
-rw-r--r-- | src/basic/unit-def.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/unit-def.c b/src/basic/unit-def.c index 64b2b2dd7e..94ec1f3d19 100644 --- a/src/basic/unit-def.c +++ b/src/basic/unit-def.c @@ -185,6 +185,7 @@ static const char* const service_state_table[_SERVICE_STATE_MAX] = { [SERVICE_STOP_SIGTERM] = "stop-sigterm", [SERVICE_STOP_SIGKILL] = "stop-sigkill", [SERVICE_STOP_POST] = "stop-post", + [SERVICE_FINAL_WATCHDOG] = "final-watchdog", [SERVICE_FINAL_SIGTERM] = "final-sigterm", [SERVICE_FINAL_SIGKILL] = "final-sigkill", [SERVICE_FAILED] = "failed", |