From 2e968f9835a7d18132df1d6c0bda57153f70b586 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 15 May 2024 12:22:39 +0200 Subject: [PATCH] test: systemctl stop user@*.service now also kills the root session --- test/common/testlib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/common/testlib.py b/test/common/testlib.py index a31bd9cf5728..ce1238d09029 100644 --- a/test/common/testlib.py +++ b/test/common/testlib.py @@ -1697,7 +1697,9 @@ def _terminate_sessions(self) -> None: raise # terminate all systemd user services for users who are not logged in - m.execute("systemctl stop user@*.service") + # since systemd 256 we stop user@*.service now also stops the root session (uid 0) + m.execute("cd /run/systemd/users/; " + "for f in $(ls); do [ $f -le 500 ] || systemctl stop user@$f; done") # Clean up "closing" sessions again, and clean user id cache for non-system users m.execute("systemctl stop systemd-logind; cd /run/systemd/users/; "