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
diff --git a/functions-common b/functions-common
index 030ff8c..0160c62 100644
--- a/functions-common
+++ b/functions-common
@@ -1394,7 +1394,7 @@
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"