We had some occurrences of failure of the debmonitor unprivileged script that runs as APT hook on swift backend hosts, where systemd fails to start the session.
$ sudo systemctl status session-22600.scope ● session-22600.scope - Session 22600 of user debmonitor Loaded: loaded (/run/systemd/transient/session-22600.scope; transient; vendor preset: enabled) Transient: yes Active: failed (Result: resources)
From syslog:
Jul 16 09:29:16 ms-be1028 systemd[1]: Created slice User Slice of debmonitor. Jul 16 09:29:16 ms-be1028 systemd[1]: Starting User Manager for UID 499... Jul 16 09:29:16 ms-be1028 systemd[1]: session-22600.scope: Failed to add PIDs to scope's control group: No such process Jul 16 09:29:16 ms-be1028 systemd[1]: Failed to start Session 22600 of user debmonitor. Jul 16 09:29:16 ms-be1028 systemd[1]: session-22600.scope: Unit entered failed state. ... Jul 16 09:29:19 ms-be1028 systemd[1]: Stopped User Manager for UID 499. Jul 16 09:29:19 ms-be1028 systemd[1]: Removed slice User Slice of debmonitor.
For a quick fix a sudo systemctl reset-failed session-22600.scope does the trick, but this task to investigate the root cause and try to find a more permanent solution.
What the script does, is dropping privileges, with su - debmonitor -c "..."