Residual processes on the agent after session disconnect

Hello,

We are testing ThinLinc 4.18.0 on a master/agent server running under Linux RHEL 9.4.
It seems to work quite well but there are many remaining processes on the agent after a session disconnect (disconnexion without saving). And some of these processes which seems to be related to matlab are zombie while matlab has not been launched inside the thinlinc session.

Here are some of such processes after 3 session testing of the same user (the login of the user has been changed to userXXX) :

userXXX     3447  0.0  0.0  21384 11264 ?        Ss   févr.04   0:00 /usr/lib/systemd/systemd --user
userXXX     3451  0.0  0.0 201936  7836 ?        S    févr.04   0:00 (sd-pam)
userXXX     3710  0.0  0.0  19756  4352 ?        Ss   févr.04   0:00 /usr/bin/dbus-broker-launch --scope user
userXXX     3711  0.0  0.0   5772  2816 ?        S    févr.04   0:00 dbus-broker --log 4 --controller 11 --machine-id bfbc4c3d8e354e65b8a85d01e9b8ee57 --max-bytes 100000000000000 --max-fds 25000000000000 --max-matches 5000000000
userXXX     3714  0.0  0.0 308580  7424 ?        Ssl  févr.04   0:00 /usr/libexec/at-spi-bus-launcher
userXXX     3723  0.0  0.0  10532  4096 ?        S    févr.04   0:00 /usr/bin/dbus-broker-launch --config-file=/usr/share/defaults/at-spi2/accessibility.conf --scope user
userXXX     3724  0.0  0.0   4980  2304 ?        S    févr.04   0:00 dbus-broker --log 4 --controller 9 --machine-id bfbc4c3d8e354e65b8a85d01e9b8ee57 --max-bytes 100000000000000 --max-fds 6400000 --max-matches 5000000000
userXXX     3728  0.0  0.0 452800  9568 ?        Ssl  févr.04   0:00 /usr/libexec/gvfsd
userXXX     3734  0.0  0.0 379936  7424 ?        Sl   févr.04   0:00 /usr/libexec/gvfsd-fuse /run/user/52055/gvfs -f
userXXX     4032  0.0  0.0 4083324 145580 ?      Sl   févr.04   0:41 /u/cdc/userXXX/.MathWorks/ServiceHost/-mw_shared_installs/v2025.1.1.2/bin/glnxa64/MathWorksServiceHost service --realm-id companion@prod@production
userXXX     4033  0.0  0.0 449636  7796 ?        Sl   févr.04   0:00 /usr/libexec/geoclue-2.0/demos/agent
userXXX     4036  0.0  0.0 831676 33696 ?        SNl  févr.04   0:00 /usr/libexec/tracker-miner-fs-3
userXXX     4069  0.0  0.0 537200 14144 ?        Ssl  févr.04   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
userXXX     4091  0.0  0.0 1296652 32892 ?       Ssl  févr.04   0:00 /usr/libexec/evolution-source-registry
userXXX     4107  0.0  0.0 450400 10648 ?        Ssl  févr.04   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
userXXX     4123  0.0  0.0 448444  8156 ?        Ssl  févr.04   0:00 /usr/libexec/gvfs-mtp-volume-monitor
userXXX     4133  0.0  0.0 448516  9868 ?        Ssl  févr.04   0:00 /usr/libexec/gvfs-goa-volume-monitor
userXXX     4139  0.0  0.0 819860 24628 ?        Ssl  févr.04   0:00 /usr/libexec/goa-daemon
userXXX     4163  0.0  0.0 531728 13152 ?        Ssl  févr.04   0:01 /usr/libexec/goa-identity-service
userXXX     4258  0.0  0.0 527140 12472 ?        Sl   févr.04   0:00 /usr/libexec/gvfsd-trash --spawner :1.7 /org/gtk/gvfs/exec_spaw/0
userXXX     4293  0.0  0.0 374924 10120 ?        Ssl  févr.04   0:00 /usr/libexec/gvfsd-metadata
userXXX     4329  0.0  0.0 1060108 34416 ?       Ssl  févr.04   0:00 /usr/libexec/evolution-calendar-factory
userXXX     4362  0.0  0.0 155880  6912 ?        Ssl  févr.04   0:00 /usr/libexec/dconf-service
userXXX     4370  0.0  0.0 880716 29468 ?        Ssl  févr.04   0:00 /usr/libexec/evolution-addressbook-factory
userXXX     4529  0.0  0.0      0     0 ?        Z    févr.04   0:00 [MathWorksServic] <defunct>
userXXX     5397  0.0  0.0 449636  8056 ?        Sl   févr.04   0:00 /usr/libexec/geoclue-2.0/demos/agent
userXXX     8552  0.0  0.0 453160 11120 ?        Ssl  févr.04   0:00 /usr/bin/gnome-keyring-daemon --start --foreground --components=secrets
userXXX    46476  0.0  0.0 449636  8056 ?        Sl   08:39   0:00 /usr/libexec/geoclue-2.0/demos/agent

Is there a way to have no remaining processes on the agent after a thinlinc logout session without any saving ?

Thanks in advance for your help.

Best regards,

Hi @yann28,

Welcome to the forum!

Here’s a response from my colleague @wilsj in regards to a similar query:

This is sadly out of our control. All of these processes are started by
systemd as of starting the desktop environment. Worth noting is that
these processes tend to die all by themselves after a while.

If you still want to get rid of them, there is loginctl disable-linger. There is also the KillUserProcesses option in logind.conf that controls this behavior.

Note that disabling lingering will break tools like screen and tmux used
inside the session. See the man pages for loginctl and logind.conf for
more details.

In your case you have other processes not started by systemd, for example user applications. But the general principle is the same - unfortunately this it is up to the desktop environment to clean up after itself.

You may be able to improve the situation by disabling any uneccesary services which leave behind residual processes, for example gnome-online-accounts(assuming this is not being used).

Hope this helps.

1 Like

Hi @aaron,

Thanks a lot @aaron for your answer. I just changed the KillUserProcesses to yes in the file /etc/systemd/logind.conf and it kills perfectly the processes after a thinlinc session.

Without changing this configuration, it would have been possible to identify thinlinc sessions in closing with loginctl and then to kill them within a script running in a cron :

$ loginctl
SESSION UID USER SEAT TTY STATE IDLE SINCE
…
58 52055 userXXX thinlinc closing no
6 52055 userXXX thinlinc closing no
9 52055 userXXX thinlinc closing no
…

N sessions listed.

$ loginctl kill-session 58 6 9

Still thanks a lot for your help. We are very happy to be able to test ThinLinc. We wish a long life to ThinLinc

Great to hear @yann28 :slight_smile: if you need anything else then you know how to reach us.

1 Like