systemd: decrease timeout when stopping services

In very rare cases, random services would hang when powering off the system,
causing the poweroff process to stall for 90 seconds before timing out the stop
job. To avoid this behaviour, minimize the effect of these random freezes by
decreasing the timeout.

The default services in our system take well under 15 seconds to stop
gracefully, so we can guarantee that a timeout will never happen under normal
circumstances.

https://jira.digi.com/browse/DEL-6794

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2019-10-17 11:42:56 +02:00
parent 9c7c5e5bfb
commit 2a0636760e
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,7 @@
# Copyright (C) 2019 by Digi International Inc.
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI += "\
file://0001-system.conf-reduce-default-stop-timeout-to-15-second.patch \
"

View File

@ -0,0 +1,29 @@
From: Gabriel Valcazar <gabriel.valcazar@digi.com>
Date: Thu, 17 Oct 2019 09:45:31 +0200
Subject: [PATCH] system.conf: reduce default stop timeout to 15 seconds
We currently don't have any services that, under normal circumstances, take
over 10 seconds to stop. In exceptional cases where services hang when stopping
due to unknown circumstances, make the timeout happen earlier to avoid stalling
the entire poweroff process for 90 seconds.
https://jira.digi.com/browse/DEL-6794
Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
---
src/core/system.conf.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/core/system.conf.in b/src/core/system.conf.in
index f0a59a7..c25257d 100644
--- a/src/core/system.conf.in
+++ b/src/core/system.conf.in
@@ -35,6 +35,8 @@
#DefaultStandardError=inherit
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
+# Digi-specific
+DefaultTimeoutStopSec=15s
#DefaultRestartSec=100ms
#DefaultStartLimitIntervalSec=10s
#DefaultStartLimitBurst=5