From: Stefan Reiter <s.reiter@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 1/2] use KillMode 'process' for systemd scope
Date: Mon, 21 Jun 2021 18:35:41 +0200 [thread overview]
Message-ID: <20210621163542.1752647-2-s.reiter@proxmox.com> (raw)
In-Reply-To: <20210621163542.1752647-1-s.reiter@proxmox.com>
KillMode 'none' is deprecated, and systemd loudly complains about that
in the journal. To avoid the warning, but keep the behaviour the same,
use KillMode 'process'.
This mode does two things differently, which we have to stop it from
doing:
* it sends SIGTERM right when the scope is cancelled (e.g. on shutdown)
-> but only to the "root" process, which in our case is the worker
instance forking QEMU, so it is already dead by the time this happens
* it sends SIGKILL to *all* children after a timeout
-> can be avoided by setting either SendSIGKILL to false, or
TimeoutStopUSec to infinity - for safety, we do both
In my testing, this replicated the previous behaviour exactly, but
without using the deprecated 'none' mode.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
Depends on updated pve-common from patch 2.
PVE/QemuServer.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 07dd14a..d5b7ead 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5286,7 +5286,9 @@ sub vm_start_nolock {
my %properties = (
Slice => 'qemu.slice',
- KillMode => 'none'
+ KillMode => 'process',
+ SendSIGKILL => 0,
+ TimeoutStopUSec => ULONG_MAX, # infinity
);
if (PVE::CGroup::cgroup_mode() == 2) {
--
2.30.2
next prev parent reply other threads:[~2021-06-21 16:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 16:35 [pve-devel] [PATCH 0/2] Work around systemd warning about KillMode 'none' Stefan Reiter
2021-06-21 16:35 ` Stefan Reiter [this message]
2021-06-22 6:02 ` [pve-devel] [PATCH qemu-server 1/2] use KillMode 'process' for systemd scope Thomas Lamprecht
2021-06-22 7:23 ` Stefan Reiter
2021-06-23 10:06 ` [pve-devel] applied: " Thomas Lamprecht
2021-06-21 16:35 ` [pve-devel] [PATCH common 2/2] systemd: allow SendSIGKILL and TimeoutStopUSec dbus properties Stefan Reiter
2021-06-22 5:45 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210621163542.1752647-2-s.reiter@proxmox.com \
--to=s.reiter@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox