1

I have problem logout on my server (and all debian-derivative servers) do not kill all user processes.

I seem to understand this is done for efficiency reasons for workstations (assumption appears to be same user will log in shortly thereafter).

As an example, on a very restricted account, I get:

mcon@cinderella:~$ pgrep --list-full -U gamer 3001599 /lib/systemd/systemd --user 3001600 (sd-pam) 3001615 /usr/bin/pipewire 3001616 /usr/bin/pipewire-media-session 3001624 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only 3001706 /usr/libexec/gvfsd 3001711 /usr/libexec/gvfsd-fuse /run/user/1002/gvfs -f 3001839 /usr/libexec/dconf-service 3001841 /usr/libexec/gvfs-udisks2-volume-monitor 3001852 /usr/libexec/gvfs-gphoto2-volume-monitor 3001860 /usr/libexec/gvfs-goa-volume-monitor 3001888 /usr/libexec/goa-daemon 3001906 /usr/libexec/goa-identity-service 3001908 /usr/libexec/gvfs-mtp-volume-monitor 3001915 /usr/libexec/gvfs-afc-volume-monitor 3002093 /usr/libexec/evolution-source-registry 3002108 /usr/libexec/gvfsd-trash --spawner :1.9 /org/gtk/gvfs/exec_spaw/0 3002112 /usr/libexec/xdg-desktop-portal 3002120 /usr/libexec/xdg-document-portal 3002124 /usr/libexec/xdg-permission-store 3002132 fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1002/doc 3002150 /usr/libexec/evolution-calendar-factory 3002162 /usr/libexec/gvfsd-metadata 3002176 /usr/libexec/evolution-addressbook-factory 3002227 /usr/libexec/bluetooth/obexd 3002924 /usr/bin/python3 /usr/share/system-config-printer/applet.py 3827100 /usr/bin/gnome-keyring-daemon --start --foreground --components=secrets 

This was taken (many) hours user gamer has logged off and after other users (including myself) used the system.

I have seen this question but that doesn't apply to my case: I do not want to prevent users from explicitly starting long-running processes via nohup or screen, but simply kill all "useless" system tasks.

I tried setting [Login] -> KillUserProcesses=yes in /etc/systemd/logind.conf but apparently nothing changed.

Note all those processes remain active for each user that ever logged in (since last reboot, of course).

How do I get rid of all those processes? Is it really needed to run some cron script to kill them? If so: how do I separate "explicitly wanted" background processes from system cruft?

P.S.: I know StackExchange policy is "one question mark per OP", but these are really various aspects of the same question.

2

1 Answer 1

0

Reboot or sudo systemctl daemon-reexec. daemon-reload only reloads units, thus it won't work.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.