<!DOCTYPE html>
<html lang="" style="line-height: 1.5; font-family: Georgia, serif; font-size: 20px; color: #1a1a1a; background-color: #fdfdfd" xml:lang="" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta content="pandoc" name="generator"/>
<meta content="width=device-width, initial-scale=1.0, user-scalable=yes" name="viewport"/>
<title>-</title>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body style="margin: 0 auto; max-width: 36em; padding-left: 50px; padding-right: 50px; padding-top: 50px; padding-bottom: 50px; hyphens: auto; overflow-wrap: break-word; text-rendering: optimizeLegibility; font-kerning: normal"><style>@media (max-width: 600px) { body { font-size: 0.9em; padding: 1em } h1 { font-size: 1.8em } }
@media print { body { background-color: transparent; color: black; font-size: 12pt } p, h2, h3 { orphans: 3; widows: 3 } h2, h3, h4 { page-break-after: avoid } }</style>
<p style="margin: 1em 0; padding: 0 0.5em">Package: systemd<br/>
Version: 253.5-1<br/>
Severity: important<br/>
Tags: upstream<br/>
X-Debbugs-Cc: <a class="email" href="mailto:tomi@nomi.cz" style="color: #1a1a1a">tomi@nomi.cz</a></p>
<p style="margin: 1em 0; padding: 0 0.5em">Since <a class="uri" href="https://github.com/systemd/systemd-stable/commit/ae83e97a51519ca33e70d7ba142cb3ed24212825" style="color: #1a1a1a">https://github.com/systemd/systemd-stable/commit/ae83e97a51519ca33e70d7ba142cb3ed24212825</a>,
services with ExitType=main (the default) and KillMode=process (not the
default, but used in e.g. libvirtd.service) are considered active even
after the main process has exited.</p>
<p style="margin: 1em 0; padding: 0 0.5em">This is clearly a bug, reported multiple times to systemd: <a href="https://github.com/systemd/systemd/issues/28030" style="color: #1a1a1a">1</a>, <a href="https://github.com/systemd/systemd/issues/27953" style="color: #1a1a1a">2</a> that has
since been fixed upstream <a href="https://github.com/systemd/systemd/pull/28000" style="color: #1a1a1a">3</a> and many
distros (Fedora, Arch, openSUSE, NixOS) are carrying the patch even
before a systemd-stable release <a href="https://github.com/systemd/systemd-stable/issues/302" style="color: #1a1a1a">4</a>
because it's quite a serious bug that breaks libvirtd socket activation
among other things.</p>
<p style="margin: 1em 0; padding: 0 0.5em">Minimal reproducer:</p>
<pre style="margin: 1em 0; overflow: auto; line-height: 125%; padding: 0 1em"><code style='font-family: Menlo, Monaco, "Lucida Console", Consolas, monospace; font-size: 85%; margin: 0; white-space: pre-wrap; padding: 0; overflow: visible; overflow-wrap: normal'>systemd-run --quiet --collect --wait --property=KillMode=process -- sh -c 'sleep 20 &' </code></pre>
<p style="margin: 1em 0; padding: 0 0.5em">This should not return immediately, but instead blocks for 30 seconds
in the affected versions of systemd.</p>
<p style="margin: 1em 0; padding: 0 0.5em">Less minimal reproducer:</p>
<ol style="padding-left: 1.7em; margin-top: 1em" type="1">
<li>install libvirt-daemon, libvirt-clients<br/>
</li>
<li>make sure the default network is up (which it wouldn't be if you're
trying to do this inside another libvirt VM due to IP range
conflict)<br/>
</li>
<li>wait until the <code style='font-family: Menlo, Monaco, "Lucida Console", Consolas, monospace; font-size: 85%; margin: 0; white-space: pre-wrap'>/usr/sbin/libvirtd --timeout 120</code> process
terminates<br/>
</li>
<li><code style='font-family: Menlo, Monaco, "Lucida Console", Consolas, monospace; font-size: 85%; margin: 0; white-space: pre-wrap'>systemctl status libvirtd.service</code> still says "active
(running)"<br/>
</li>
<li><code style='font-family: Menlo, Monaco, "Lucida Console", Consolas, monospace; font-size: 85%; margin: 0; white-space: pre-wrap'>virsh connect</code> hangs indefinitely</li>
</ol>
<p style="margin: 1em 0; padding: 0 0.5em">Can we please get the fix <a href="https://github.com/systemd/systemd/pull/28000" style="color: #1a1a1a">3</a> added to
Debian as well?</p>
<p style="margin: 1em 0; padding: 0 0.5em">(Also, I believe Luca is a maintainer of v252-stable, where the fix
also needs to be backported. v252.11 currently in Debian testing and
stable-proposed-updates is affected as well. I tried to highlight this
issue a week ago <a href="https://github.com/systemd/systemd/pull/28000#issuecomment-1608296400" style="color: #1a1a1a">5</a>
but I understand GitHub notifications are easy to miss.)</p>
<p style="margin: 1em 0; padding: 0 0.5em">-- Package-specific info:</p>
<p style="margin: 1em 0; padding: 0 0.5em">-- System Information:<br/>
Debian Release: trixie/sid<br/>
APT prefers unstable<br/>
APT policy: (500, 'unstable')<br/>
Architecture: amd64 (x86_64)</p>
<p style="margin: 1em 0; padding: 0 0.5em">Kernel: Linux 6.3.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)<br/>
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not
set<br/>
Shell: /bin/sh linked to /usr/bin/dash<br/>
Init: systemd (via /run/systemd/system)<br/>
LSM: AppArmor: enabled</p>
<p style="margin: 1em 0; padding: 0 0.5em">Versions of packages systemd depends on:<br/>
ii libacl1 2.3.1-3<br/>
ii libaudit1 1:3.0.9-1<br/>
ii libblkid1 2.38.1-5+b1<br/>
ii libc6 2.37-3<br/>
ii libcap2 1:2.66-4<br/>
ii libcryptsetup12 2:2.6.1-4<br/>
ii libfdisk1 2.38.1-5+b1<br/>
ii libgcrypt20 1.10.2-2<br/>
ii libkmod2 30+20230519-1<br/>
ii liblz4-1 1.9.4-1<br/>
ii liblzma5 5.4.1-0.2<br/>
ii libmount1 2.38.1-5+b1<br/>
ii libp11-kit0 0.24.1-2<br/>
ii libseccomp2 2.5.4-1+b3<br/>
ii libselinux1 3.4-1+b6<br/>
ii libssl3 3.0.9-1<br/>
ii libsystemd-shared 253.5-1<br/>
ii libsystemd0 253.5-1<br/>
ii libzstd1 1.5.5+dfsg2-1<br/>
ii mount 2.38.1-5+b1<br/>
ii systemd-dev 253.5-1</p>
<p style="margin: 1em 0; padding: 0 0.5em">Versions of packages systemd recommends:<br/>
ii dbus [default-dbus-system-bus] 1.14.8-1<br/>
ii systemd-timesyncd [time-daemon] 253.5-1</p>
<p style="margin: 1em 0; padding: 0 0.5em">Versions of packages systemd suggests:<br/>
ii libfido2-1 1.13.0-1<br/>
pn libqrencode4 <none><br/>
pn libtss2-esys-3.0.2-0 <none><br/>
pn libtss2-mu0 <none><br/>
pn libtss2-rc0 <none><br/>
ii polkitd 122-4<br/>
pn systemd-boot <none><br/>
pn systemd-container <none><br/>
pn systemd-homed <none><br/>
ii systemd-resolved 253.5-1<br/>
pn systemd-userdbd <none></p>
<p style="margin: 1em 0; padding: 0 0.5em">Versions of packages systemd is related to:<br/>
pn dbus-user-session <none><br/>
pn dracut <none><br/>
ii initramfs-tools 0.142<br/>
pn libnss-systemd <none><br/>
ii libpam-systemd 253.5-1<br/>
ii udev 253.5-1</p>
<p style="margin: 1em 0; padding: 0 0.5em">-- no debconf information</p>
<div class="signature" style="color: #999; font-family: monospace; white-space: pre; margin: 1em 0 0 0; font-size: 80%"><span class="leader">-- </span><p style="margin: 1em 0; padding: 0 0.5em">Tomáš "liskin" ("Pivník") Janoušek, <a class="uri" href="https://lisk.in/" style="color: #1a1a1a">https://lisk.in/</a></p>
</div>
</body>
</html>