On Fri, Nov 6, 2020, 23:31 Phillip Susi <[email protected]> wrote: > > Lennart Poettering writes: > > > Are you running systemd? If so, please get rid of "killproc". It will > > interfere with systemd's service management. > > I see.. apparently Ubuntu still has it around. How does systemd handle > it? For instance, if a user logged in and forked off a background > process, how does systemd make sure it gets killed when isolating to > rescue.target? Does it decide that it is still connected to ssh.service > and so won't kill it when isolating? I'd like to make sure anything > like that is killed and maybe restart sshd if needed. >
No, user processes are moved to their own cgroup and unit (usually session-XX.scope nested under user-UID.slice) as soon as sshd calls pam_systemd during login. (This includes also the sshd "worker" process which handles that connection, which is the one calling PAM.) You can see the "contents" of sshd.service in its `systemctl status`, and you can run `systemd-cgls` to get a tree of all cgroups and which processes they contain. I don't exactly know in which conditions the session scopes (or the whole user slice) are stopped. But in any case, stopping a unit should kill all processes with no "leftovers".
_______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
