]> git.proxmox.com Git - pve-ha-manager.git/commit
is_node_shutdown: check for correct systemd targets
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Dec 2016 08:33:44 +0000 (09:33 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 5 Jan 2017 12:10:37 +0000 (13:10 +0100)
commit61ae38eb6fc5ab351fb61f2323776819e20538b7
tree7cc07be08facde8a1aca2d834d5f1f2067d97195
parente4bcfac38e8f5781e75b9b7033803375ea070d3a
is_node_shutdown: check for correct systemd targets

shutdown.target is active every time when the node shuts down, be it
reboot, poweroff, halt or kexec.
As we want to return true only when the node powers down without a
restart afterwards this was wrong.
Match only poweroff.target and halt.target, those two systemd targets
which cause a node shutdown without a reboot.

Enhance also the regular expression so that we do not falsely match
when a target includes poweroff.target in its name, e.g.
not-a-poweroff.target

Also pass the 'full' flag to systemctl to ensure that target name do
not get ellipsized or cut off.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/HA/Env/PVE2.pm