From f5c673cba768bd8d67fb4f44dd9f8a15e1287ef0 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 5 Feb 2019 09:40:17 +0100 Subject: [PATCH] fix #2043: vm start: always stop existing systemd scopes commit 3c23aa808ccc946bad92d9bc63b6f833c61d0f52 tried to fix a issue where after a stop mode backup a scope could still linger around, but it actually removed the wrong check. If we want to remove a lingering, not yet cleaned up, scope we need to check if said scope exists not if a VM process is still running. While they are corelated the scope will always get cleaned up _after_ it's processes are gone. Should fix #2043, but as this is seemingly not that easy to fix one for all I'll put the should as disclaimer here. Signed-off-by: Thomas Lamprecht Cc: Wolfgang Bumiller --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 4a903a6..6dc68a4 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -5204,7 +5204,7 @@ sub vm_start { PVE::Storage::activate_volumes($storecfg, $vollist); - if (!check_running($vmid, 1)) { + if (-d "/sys/fs/cgroup/systemd/qemu.slice/$vmid.scope") { eval { run_command(['/bin/systemctl', 'stop', "$vmid.scope"], outfunc => sub {}, errfunc => sub {}); -- 2.39.2