Set logind.conf InhibitDelayMaxSec to 600 seconds
Allow system to lock for shutdown for 10 minutes by default.
Related-Prod: PRODX-43725
Change-Id: I19c3c7c0d256fec2d846a267ab70f3a47b942892
diff --git a/de/heat-templates/scripts/functions.sh b/de/heat-templates/scripts/functions.sh
index 609a6be..f09e6ea 100644
--- a/de/heat-templates/scripts/functions.sh
+++ b/de/heat-templates/scripts/functions.sh
@@ -150,6 +150,44 @@
sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/g' /etc/apt/apt.conf.d/*
}
+function configure_logind_conf {
+
+ cat <<EOF >/etc/systemd/logind.conf
+[Login]
+#NAutoVTs=6
+#ReserveVT=6
+#KillUserProcesses=no
+#KillOnlyUsers=
+#KillExcludeUsers=root
+InhibitDelayMaxSec=600
+#UserStopDelaySec=10
+#HandlePowerKey=poweroff
+#HandleSuspendKey=suspend
+#HandleHibernateKey=hibernate
+#HandleLidSwitch=suspend
+#HandleLidSwitchExternalPower=suspend
+#HandleLidSwitchDocked=ignore
+#HandleRebootKey=reboot
+#PowerKeyIgnoreInhibited=no
+#SuspendKeyIgnoreInhibited=no
+#HibernateKeyIgnoreInhibited=no
+#LidSwitchIgnoreInhibited=yes
+#RebootKeyIgnoreInhibited=no
+#HoldoffTimeoutSec=30s
+#IdleAction=ignore
+#IdleActionSec=30min
+#RuntimeDirectorySize=10%
+#RuntimeDirectoryInodesMax=400k
+#RemoveIPC=yes
+#InhibitorsMax=8192
+#SessionsMax=8192
+
+EOF
+
+ systemctl daemon-reload
+
+}
+
function install_required_packages {
local pkg_list="apt-transport-https ca-certificates curl software-properties-common jq unzip atop iptables-persistent socat ntp rng-tools open-iscsi nfs-common"
diff --git a/de/heat-templates/scripts/launch.sh b/de/heat-templates/scripts/launch.sh
index 9b1834c..e5392ac 100644
--- a/de/heat-templates/scripts/launch.sh
+++ b/de/heat-templates/scripts/launch.sh
@@ -124,6 +124,7 @@
# at the very beginning in the same order.
ucp)
configure_sysctl_limits
+ configure_logind_conf
disable_unattended_upgr
setup_bind_mounts
wait_for_external_network
@@ -167,6 +168,7 @@
;;
master)
configure_sysctl_limits
+ configure_logind_conf
disable_unattended_upgr
setup_bind_mounts
wait_for_external_network
@@ -202,6 +204,7 @@
;;
worker)
configure_sysctl_limits
+ configure_logind_conf
disable_unattended_upgr
setup_bind_mounts
wait_for_external_network