Skip to content

Commit

Permalink
test: systemctl stop user@*.service now also kills the root session
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed May 15, 2024
1 parent 489535b commit c40c9e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/; "
Expand Down

0 comments on commit c40c9e6

Please sign in to comment.