service: handle abort stops with dedicated timeout

System Internals / systemd - Jan Klötzke [preh.de] - 12 April 2019 15:32 EDT

When shooting down a service with SIGABRT the user might want to have a much longer stop timeout than on regular stops/shutdowns. Especially in the face of short stop timeouts the time might not be sufficient to write huge core dumps before the service is killed.

This commit adds a dedicated (Default)TimeoutAbortSec= timer that is used when stopping a service via SIGABRT. In all other cases the existing TimeoutStopSec= is used. The timer value is unset by default to skip the special handling and use TimeoutStopSec= for state 'stop-watchdog' to keep the old behaviour.

If the service is in state 'stop-watchdog' and the service should be stopped explicitly we still go to 'stop-sigterm' and re-apply the usual TimeoutStopSec= timeout.

dc653bf487 service: handle abort stops with dedicated timeout
docs/TRANSIENT-SETTINGS.md | 1 +
man/systemd-system.conf.xml | 12 ++++++---
man/systemd.service.xml | 29 +++++++++++++++++++++
src/core/dbus-manager.c | 22 ++++++++++++++++
src/core/dbus-service.c | 22 ++++++++++++++++
src/core/load-fragment-gperf.gperf.m4 | 1 +
src/core/load-fragment.c | 36 ++++++++++++++++++++++++++
src/core/load-fragment.h | 1 +
src/core/main.c | 39 +++++++++++++++++++++++++++++
src/core/manager.h | 6 +++++
src/core/service.c | 19 ++++++++++----
src/core/service.h | 6 +++++
src/core/system.conf.in | 1 +
src/core/user.conf | 1 +
src/shared/conf-parser.h | 1 +
test/fuzz/fuzz-unit-file/directives.service | 2 ++
16 files changed, 190 insertions(+), 9 deletions(-)

Upstream: github.com


  • Share