From 2a0636760ecdb6b2b528ae7296962d4c7c53dccc Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Thu, 17 Oct 2019 11:42:56 +0200 Subject: [PATCH] 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 --- .../systemd/systemd-conf.bbappend | 7 +++++ ...ce-default-stop-timeout-to-15-second.patch | 29 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 meta-digi-dey/recipes-core/systemd/systemd-conf.bbappend create mode 100644 meta-digi-dey/recipes-core/systemd/systemd-conf/0001-system.conf-reduce-default-stop-timeout-to-15-second.patch diff --git a/meta-digi-dey/recipes-core/systemd/systemd-conf.bbappend b/meta-digi-dey/recipes-core/systemd/systemd-conf.bbappend new file mode 100644 index 000000000..f0a949fef --- /dev/null +++ b/meta-digi-dey/recipes-core/systemd/systemd-conf.bbappend @@ -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 \ +" diff --git a/meta-digi-dey/recipes-core/systemd/systemd-conf/0001-system.conf-reduce-default-stop-timeout-to-15-second.patch b/meta-digi-dey/recipes-core/systemd/systemd-conf/0001-system.conf-reduce-default-stop-timeout-to-15-second.patch new file mode 100644 index 000000000..0b210dfd8 --- /dev/null +++ b/meta-digi-dey/recipes-core/systemd/systemd-conf/0001-system.conf-reduce-default-stop-timeout-to-15-second.patch @@ -0,0 +1,29 @@ +From: Gabriel Valcazar +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 +--- + 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