Bug#897221: Session logout doesn't TERMinate all processes
- To: Maximiliano Curia <maxy@debian.org>
- Cc: 897221@bugs.debian.org
- Subject: Bug#897221: Session logout doesn't TERMinate all processes
- From: Didier 'OdyX' Raboud <odyx@debian.org>
- Date: Wed, 06 Jun 2018 19:38:48 +0200
- Message-id: <[🔎] 6209465.qmYAc0Nggt@odyx.org>
- Reply-to: Didier 'OdyX' Raboud <odyx@debian.org>, 897221@bugs.debian.org
- In-reply-to: <20180503155312.3xcwnttqdpr56qib@neoptolemo.gnuservers.com.ar>
- References: <152508367728.11695.502009118365066522.reportbug@gyllingar> <20180503155312.3xcwnttqdpr56qib@neoptolemo.gnuservers.com.ar> <152508367728.11695.502009118365066522.reportbug@gyllingar>
!Holà Maxy!
Le jeudi, 3 mai 2018, 17.53:12 h CEST Maximiliano Curia a écrit :
> El 2018-04-30 a las 12:21 +0200, Didier 'OdyX' Raboud escribió:
> > I routinely run two sessions in parallel (pro & private); and I noticed
> > that sddm (which I assume is handling the logind session) doesn't
> > coherently TERMinate (or KILL after some delay) processes from a
> > logged-out session.
> >
> > Some of these consume ressources (akonadiserver is the usual culprit), but
> > more importantly; keeping these alive will break subsequent sessions for
> > the same user (plasma, akonadi, etc).
>
> I guess akonadiserver is started as a detached process, so ksmserver doesn't
> know about it.
>
> Anyway the problem are the processes that are in the systemd concept of
> session but not in the kde concept of session, those are the ones that
> systemd is waiting for, and ksmserver has long forgotten about them.
>
> Please check loginctl session-status <id> (The id can be obtained with
> loginctl list-sessions)
I noticed it also appears when disconnecting, and reconnecting back. Akonadi
is then broken, etc etc.
Hereattached is a log of the processes from a stopped session. It really feels
like plasma doesn't stop its child processes from the systray either.
> Mmh, this is a complex problem. Debian systemd reverts the default logind
> configuration KillUserProcesses, that effectively terminates the session
> when the user logs out, and most desktop environments assume this is set to
> it's default value, so they don't have to deal with the processes started
> by systemd --user, which, by the way, the desktop environment had nothing
> to do with.
>
> Also, kde does nothing to remember which processes were started as autostart
> desktop files.
>
> Gnome "fixes" this by terminating the logind session, as if
> KillUserProcesses was set, at the cost of breaking tmux and screen (which is
> the reason why Debian reverts the KillUserProcesses setting on the first
> place).
>
> So, either we need to fix tmux and screen to they can be detached from the
> logind session, or fix the kde concept of session so it matches better what
> logind expects.
The first alternative looks like the correct thing to do to me. So a route to
fix this is for systemd to revert the KillUserProcesses back to upstream's
default, right? This was apparently last reinforced in systemd 234-3 and was
discussed in #825394.
But it doesn't seem like this would gather consensus currently. How hard is it
to get KDE to grow better login session processes handling?
Cheers,
OdyX
3 - didier (1000)
Since: Wed 2018-06-06 18:38:57 CEST; 45min ago
Leader: 1849
Seat: seat0; vc7
Display: :0
Service: sddm; type x11; class user
Desktop: KDE
State: closing
Unit: session-3.scope
├─ 2690 /usr/lib/postgresql/9.6/bin/postgres -D /home/didier/.local/share/akonadi/db_data -k/tmp/akonadi-didier.bR0FSO -h
├─ 2695 postgres: checkpointer process
├─ 2696 postgres: writer process
├─ 2697 postgres: wal writer process
├─ 2698 postgres: autovacuum launcher process
├─ 2699 postgres: stats collector process
├─ 2955 /usr/lib/at-spi2-core/at-spi-bus-launcher --launch-immediately
├─ 2976 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
├─ 2986 /usr/bin/perl /usr/bin/parcimonie-applet
├─ 3083 /usr/bin/python3 /usr/bin/hp-systray -x
├─ 3086 /usr/bin/python3 /usr/bin/hp-systray -x
├─ 3920 /usr/lib/x86_64-linux-gnu/libexec/kf5/kio_http_cache_cleaner
├─20252 postgres: didier akonadi [local] idle
├─20277 postgres: didier akonadi [local] idle
├─20278 postgres: didier akonadi [local] idle
├─20507 postgres: didier akonadi [local] idle
├─20509 postgres: didier akonadi [local] idle
├─20792 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
├─21250 postgres: didier akonadi [local] idle
├─21252 postgres: didier akonadi [local] idle
├─21318 postgres: didier akonadi [local] idle
└─21377 postgres: didier akonadi [local] idle
jun 06 18:38:57 gyllingar sddm-helper[1871]: Adding cookie to "/home/didier/.Xauthority"
jun 06 18:39:04 gyllingar /hp-systray[2797]: hp-systray[2797]: error: option -s not recognized
jun 06 18:39:54 gyllingar sudo[3695]: didier : TTY=pts/0 ; PWD=/home/didier ; USER=root ; COMMAND=/usr/bin/aptitude
jun 06 18:39:54 gyllingar sudo[3695]: pam_unix(sudo:session): session opened for user root by didier(uid=0)
jun 06 18:50:59 gyllingar sudo[3695]: pam_unix(sudo:session): session closed for user root
jun 06 19:21:33 gyllingar sddm-helper[1849]: [PAM] Closing session
jun 06 19:21:33 gyllingar sddm-helper[1849]: pam_unix(sddm:session): session closed for user didier
jun 06 19:21:33 gyllingar sddm-helper[1849]: pam_kwallet5(sddm:session): pam_kwallet5: pam_sm_close_session
jun 06 19:21:33 gyllingar sddm-helper[1849]: pam_kwallet5(sddm:setcred): pam_kwallet5: pam_sm_setcred
jun 06 19:21:33 gyllingar sddm-helper[1849]: [PAM] Ended.
Reply to: