[pve-devel] [PATCH manager 1/5] pve-manager.service: do not allow stop to timeout

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Sep 8 16:31:26 CEST 2017


This services is responsible for bringing up 'onboot' marked guests
on host power-on and stop _all_ guests gracefully on host shutdown
(be it reboot, shutdow, halt, ..)

It's type is set to 'oneshot', which implies a TimeoutStartSec of
'infinity', by default. With Jessies Version of Systemd the
TimeoutStopSec defaulted to TimeoutStartSec, if not set – so also
'infinity'.
But, Debian Stretchs Version of Systemd makes TimeoutStopSec defaults
to 'DefaultTimeoutStopSec' if it was not set, which is by default 90
seconds – much less than infinity.

This may cause non-gracefull shutdowns of guests, as after the 90
seconds systemd sends a SIGKILL to the pvesh 'stopall' process.
This may end in a bad guest state then. But besides that it can also
lead to a hanging shutdown in some cirumstancesm, as some guest still
operated on storages, so systemd-shutdown - the binary which gets
exec'ed by systemd to become the new PID 1 cannot finish its
sync/umount/shutdown procedure. It has a watchdog armed on sync, if
that triggers you may even get a fully shut down system.
Else it can possibly hang forever, at least until the power plug gets
pulled or similar actions are taken.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 bin/init.d/pve-manager.service | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/init.d/pve-manager.service b/bin/init.d/pve-manager.service
index 4313cd52..9f4e6277 100644
--- a/bin/init.d/pve-manager.service
+++ b/bin/init.d/pve-manager.service
@@ -23,6 +23,7 @@ Type=oneshot
 RemainAfterExit=yes
 StandardOutput=null
 StandardError=null
+TimeoutSec=infinity
 
 [Install]
 WantedBy=multi-user.target
-- 
2.11.0





More information about the pve-devel mailing list