Applet does not terminate at end of X desktop session

Bug #1877528 reported by Daniel Richard G.
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
System Config Printer
Fix Released
Unknown
lightdm (Ubuntu)
New
Undecided
Unassigned
sddm (Ubuntu)
New
Undecided
Unassigned
system-config-printer (Debian)
New
Unknown
system-config-printer (Ubuntu)
Triaged
Low
Unassigned
systemd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

This concerns system-config-printer 1.5.12-0ubuntu1 in Ubuntu focal.

I log into the Xfce desktop, and then logout. The screen returns to the LightDM login screen.

A few minutes later, "loginctl list-sessions" shows the following:

    SESSION UID USER SEAT TTY
          9 0 root
         c2 1000 skunk seat0
         c3 116 lightdm seat0

    3 sessions listed.

Output from "loginctl session-status c2":

    c2 - skunk (1000)
               Since: Fri 2020-05-08 03:09:05 EDT; 9min ago
              Leader: 2530
                Seat: seat0; vc7
             Display: :0
             Service: lightdm; type x11; class user
             Desktop: xubuntu
               State: closing
                Unit: session-c2.scope
                      └─2856 /usr/bin/python3 /usr/share/system-config-printer/applet.py

This process sticks around forever until I kill it, or its parent "systemd --user" process. Only then does the session disappear from list-sessions.

When I run "session-status" while I'm logged in, I see a list of nearly 30 desktop-related processes. All of them except this one go away on logout. This one should too.

Tags: focal
Revision history for this message
Daniel Richard G. (skunk) wrote :

This bug has LP: 1871726 as a quasi-parent.

That one system-config-printer process shown in session-status is deceptive; ps(1) shows a much larger number of processes still remaining from the login session. When the s-c-p process goes away, however, all the others follow. The impact of this issue, then, is not limited to a single lingering process.

Revision history for this message
Daniel Richard G. (skunk) wrote :

This bug was reported three years ago in Debian:

    https://bugs.debian.org/863227

Changed in system-config-printer (Ubuntu):
importance: Undecided → Low
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :
Changed in system-config-printer:
status: Unknown → New
Changed in system-config-printer (Ubuntu):
status: New → Triaged
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The upstream author has tested and found out that the problem only occurs with lightdm and not with gdm as desktop manager, especially the ones showing the problem are sddm, kdm, lightdm and the ones not showing the problem are gdm and lxdm. Adding desktop manager tasks ...

See this comment and following:

https://github.com/OpenPrinting/system-config-printer/issues/175#issuecomment-627771765

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I did not find the package which contains kdm (probably the desktop manager of KDE), if someone could add the appropriate task for this one would be great.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Added systemd task because of the this comment on the upstream but by the original poster of this Ubuntu bug report:

https://github.com/OpenPrinting/system-config-printer/issues/175#issuecomment-627870677

Revision history for this message
Balint Reczey (rbalint) wrote :

Per https://github.com/OpenPrinting/system-config-printer/issues/175#issuecomment-627964091 there is a possible solution even with how systemd works today, marking as Invalid for systemd.

Changed in systemd (Ubuntu):
status: New → Invalid
Revision history for this message
Daniel Richard G. (skunk) wrote :

Aaaand the upstream has decided they can't/won't fix this issue.

One thing that bothers me about this whole situation is that, in order for background services like this one to be cleaned up after logout, they need to behave "correctly." From my point of view, this is backwards.

When the system is preparing to reboot, it first sends SIGTERM to all user processes, waits a few seconds, and then sends SIGKILL. Processes that behave correctly are allowed to close down cleanly, and those that don't, are terminated forcibly. If you didn't have that SIGKILL part, then one badly-behaving process could delay the reboot indefinitely. By doing things this way, good behavior is rewarded, but not required.

Something like that should be the case for user sessions, although there are exceptions (screen, tmux, nohup), and SIGKILL might be excessive. The upstream bug mentioned a few other processes that remained visible under session-status, and I myself have seen similar behavior from at-spi2-core (haven't determined yet if a bug report is in order for that one).

We're going to be fighting a losing battle if every single desktop background service in Ubuntu has to do things correctly in order to avoid keeping the session open after logout. There needs to be a failsafe of some kind.

Changed in system-config-printer:
status: New → Fix Released
Changed in system-config-printer (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.