From 3b815a3cb2537885b501ad559bfd69ad5efb9085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulko?= Date: Tue, 14 Nov 2017 16:04:51 +0100 Subject: [PATCH] Provide finite value for systemd's TimeoutStopSec This commit switches TimeoutStopSec in DevStack's systemd unit files from "infinity" to "300". There are two motivations for that change: * 5 minutes should be more than enough to stop a service. * systemd included in CentOS 7 and RHEL 7 doesn't support "infinity" as a value, "0" should be provided instead. When "infinity" is set, systemd will kill the service instantly, leaving service children processes orphaned. Instead of differentiating here, we can just set a sane, finite number. Closes-Bug: 1731275 Change-Id: I0a079ea9879fa4fbba23104c2f5ab6e0721a2a2a --- functions-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-common b/functions-common index 030ff8c02d..0160c622b7 100644 --- a/functions-common +++ b/functions-common @@ -1394,7 +1394,7 @@ function write_user_unit_file { iniset -sudo $unitfile "Service" "User" "$user" iniset -sudo $unitfile "Service" "ExecStart" "$command" iniset -sudo $unitfile "Service" "KillMode" "process" - iniset -sudo $unitfile "Service" "TimeoutStopSec" "infinity" + iniset -sudo $unitfile "Service" "TimeoutStopSec" "300" iniset -sudo $unitfile "Service" "ExecReload" "$KILL_PATH -HUP \$MAINPID" if [[ -n "$group" ]]; then iniset -sudo $unitfile "Service" "Group" "$group"