]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-35-LOGIN: test coldplug without fdstore on kernels with pidfd id 39440/head
authorMike Yuan <me@yhndnzj.com>
Fri, 24 Oct 2025 21:40:12 +0000 (23:40 +0200)
committerMike Yuan <me@yhndnzj.com>
Sat, 25 Oct 2025 17:42:58 +0000 (19:42 +0200)
test/units/TEST-35-LOGIN.sh

index 56059ee5e4911c4eb29ad12e1f4e17696423f7c4..813ea5938036c7e70ca7a240d253df8518e713a3 100755 (executable)
@@ -32,13 +32,15 @@ Environment=SYSTEMD_LOG_LEVEL=debug
 EOF
 
     # We test "coldplug" (completely stop and start logind) here. So we need to preserve
-    # the fdstore, which might contain session leader pidfds. This is extremely rare use case
-    # and shall not be considered fully supported.
+    # the fdstore, which might contain session leader pidfds, but only if pidfd id isn't
+    # a thing. This is extremely rare use case and shall not be considered fully supported.
     # See also: https://github.com/systemd/systemd/pull/30610#discussion_r1440507850
-    systemctl edit --runtime --stdin systemd-logind.service --drop-in=fdstore-preserve.conf <<EOF
+    if systemd-analyze compare-versions "$(uname -r)" lt 6.9; then
+        systemctl edit --runtime --stdin systemd-logind.service --drop-in=fdstore-preserve.conf <<EOF
 [Service]
 FileDescriptorStorePreserve=yes
 EOF
+    fi
 
     systemctl restart systemd-logind.service
 }