Observed some systemd related processes never stopping. Investigating, they are connected to Java-based services, potentially caused by those being started up manually via su
.
$ sudo loginctl user-status username
username (1014)
Since: Tue 2025-01-28 04:03:56 CST; 2 days ago
State: closing
Sessions: 100
Linger: no
Unit: user-1014.slice
├─session-100.scope
│ ├─1037532 bash /some/script
│ ├─1037541 /usr/lib/jvm/jdk/bin/java -parameters
│ ├─1039230 /usr/java/default/bin/java -parameters
│ ├─1039510 /usr/java/default/bin/java -parameters
│ └─1056980 /usr/java/default/bin/java -parameters
└─[email protected]
└─init.scope
├─1007530 /usr/lib/systemd/systemd --user
└─1007534 (sd-pam)
While the systemd processes not stopping is similar to systemd --user & sd-pam Processes Never Stop , here the shared slice seems to be more of an interest.
a) Does the services being attached to the user slice mean they would potentially share resource limits with that user, not the service account?
b) Are there any other implications from the services running in the user slice?
c) Are there any reasonable workarounds to prevent this from happening, besides using proper startup scripts / systemd services?
Edit: just to clarify, I observed this after the actions of other users. Personally, I've clashed with people on not becoming other users for at least 10 years by now :)