lightdm greeter session not properly shut down at login

Bug #1637758 reported by Alberts Muktupāvels
42
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

I am using lightdm with 2 seats. After 2409 revision randomly one of two seats does not work correctly.

xsettings plugin from unity-settings-daemon or gnome-settings-deamon fails to start because there is already _XSESSION_S* manager running.

After revision 2409 in system monitor I see that there is still running unity-settings-daemon started by lightdm. Reverting this revision fixes my problem.

Related branches

summary: - Revision 2384 introduces regression
+ Revision 2409 introduces regression
description: updated
Martin Pitt (pitti)
Changed in lightdm:
assignee: nobody → Martin Pitt (pitti)
affects: lightdm → lightdm (Ubuntu)
Changed in lightdm (Ubuntu):
milestone: none → ubuntu-16.11
Martin Pitt (pitti)
tags: added: systemd-session
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Revision 2409 introduces regression

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lightdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

> After revision 2409 in system monitor I see that there is still running unity-settings-daemon started by lightdm.

I can confirm that part. This is from https://code.launchpad.net/~pitti/unity-greeter/systemd-indicators/+merge/309321, we need to stop nm-applet and the unity-settings-daemon from the lightdm session. I retitle the bug accordingly.

The change in lightdm itself (http://bazaar.launchpad.net/~lightdm-team/lightdm/trunk/revision/2409) might exhibit an underlying bug (presumably the "more than one settings-daemon), but it is by itself a correct change.

summary: - Revision 2409 introduces regression
+ lightdm greeter session not properly shut down at login
affects: lightdm (Ubuntu) → unity-greeter (Ubuntu)
Changed in unity-greeter (Ubuntu):
status: Confirmed → New
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Actually, I was able to confirm this on an older zesty VM, but on current zesty this is working well now. Can you confirm?

Revision history for this message
Martin Pitt (pitti) wrote :

> This is from https://code.launchpad.net/~pitti/unity-greeter/systemd-indicators/+merge/309321, we need to stop nm-applet and the unity-settings-daemon from the lightdm session. I retitle the bug accordingly.

Actually, no -- this MP didn't even land yet, so the leaked unity-settings-daemon and nm-applet are still from the upstart-controlled session. So, can you please upgrade to current zesty and re-confirm? If you still get this, please give me the output of "loginctl" and "loginctl session-status XX" where XX is the session number (like "c1") from the first command that applies to lightdm.

Changed in unity-greeter (Ubuntu):
status: In Progress → Incomplete
affects: unity-greeter (Ubuntu) → lightdm (Ubuntu)
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

What do you mean with current zesty? I just installed all updates (I don't use proposed), but I have not restarted pc and/or lightdm...

If /usr/lib/lightdm/lightdm-greeter-session has this line:
eval `dbus-launch --sh-syntax`

Then my second seat / session works - I can logout & login without problems.

When I restore this line:
[ -n "$DBUS_SESSION_BUS_ADDRESS" ] || eval `dbus-launch --sh-syntax`

Problem is back. Every time I try to login unity-settings-daemon started from lightdm is still running...

alberts@ga-b75m-d3h:~$ loginctl
   SESSION UID USER SEAT TTY
        c4 1001 flashback seat1
         2 120 debian-spamd /dev/pts/8
       c42 1001 flashback seat1
        c3 1000 alberts seat0
       c43 111 lightdm seat1
       c44 1001 flashback seat1

6 sessions listed.

alberts@ga-b75m-d3h:~$ loginctl session-status c43
c43 - lightdm (111)
           Since: Tue 2016-11-08 18:16:59 EET; 2min 3s ago
          Leader: 20942
            Seat: seat1
         Display: :0
         Service: lightdm-greeter; type x11; class greeter
           State: closing
            Unit: session-c43.scope
                  ├─20972 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
                  ├─20983 nm-applet
                  └─20985 /usr/lib/unity-settings-daemon/unity-settings-daemon

nov 08 18:16:59 ga-b75m-d3h systemd[1]: Started Session c43 of user lightdm.
nov 08 18:16:59 ga-b75m-d3h org.a11y.atspi.Registry[20970]: SpiRegistry daemon is running with well-known name - org.a11y.atsp
nov 08 18:17:03 ga-b75m-d3h lightdm[20942]: pam_unix(lightdm-greeter:session): session closed for user lightdm

Revision history for this message
Iain Lane (laney) wrote : Re: [Bug 1637758] Re: lightdm greeter session not properly shut down at login

On Tue, Nov 08, 2016 at 04:19:33PM -0000, Alberts Muktupāvels wrote:
> What do you mean with current zesty? I just installed all updates (I
> don't use proposed), but I have not restarted pc and/or lightdm...

Try to restart. For me the problem is gone indeed. I don't really
understand why, but it looks like the new systemd (232-2git1) fixed it.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Ads20000 (ads20000) wrote :

Installing all updates and rebooting still affects my duplicates (I'm not using two seats(?) but they're duplicates according to Ian Lane).

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Restart did help. :)

Changed in lightdm (Ubuntu):
status: Incomplete → Invalid
Martin Pitt (pitti)
Changed in lightdm (Ubuntu):
milestone: ubuntu-16.11 → none
Revision history for this message
Ads20000 (ads20000) wrote :

First time I restarted (after running Update Manager), the menus were still broken. Second time I restarted (didn't update), they were fine. Third time I restarted (after sudo apt update ; sudo apt dist-upgrade), they were broken again. Fourth time I restarted (didn't update), they were fine. Fifth time I restarted, also fine. Sixth time, also fine. Seventh time (after sudo apt update ; sudo apt dist-upgrade), also fine.

Systemd version: 232-2git1
Lightdm version: 1.20.0-0ubuntu2

I've attached a list of changes made by Apt and reboot times.

Can people try rebooting a few times and see if they can try and reproduce the bug (at least, the one in my duplicates)?

Revision history for this message
Iain Lane (laney) wrote :

It is indeed happening again for me.

I think that it didn't happen with systemd 232-2git1 and it does again with 232-3 - I've tried downgrading and upgrading a few times and it was reliably correlated with that.

Changed in lightdm (Ubuntu):
status: Invalid → Triaged
importance: Undecided → High
Revision history for this message
Iain Lane (laney) wrote :

Ok, so I built a systemd without debian/patches/debian/core-don-t-use-the-unified-hierarchy-for-the-systemd-cgro.patch and it seems to work. Not sure what that says ...

Revision history for this message
Iain Lane (laney) wrote :

That is, if I remember correctly

231-10 bad
232-2git1 good
232-3 bad
232-3 with the above patch reverted good

Revision history for this message
Martin Pitt (pitti) wrote :

Confirmed. With 232-3 I also get the duplicate nm-applet, one is from the lightdm session.

Changed in lightdm (Ubuntu):
status: Triaged → In Progress
milestone: none → ubuntu-16.11
Martin Pitt (pitti)
no longer affects: systemd (Ubuntu)
Martin Pitt (pitti)
Changed in lightdm (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.20.0-0ubuntu3

---------------
lightdm (1.20.0-0ubuntu3) zesty; urgency=medium

  * Add debian/patches/terminate-session.patch: Terminate leftover processes
    in greeter session. It can happen that the greeter session does not
    properly clean up itself on logout. This causes leaked processes like
    settings-daemon which act on the user session as they share the same
    $DISPLAY. Ask logind to terminate remaining processes in the greeter
    session on closing, which is more robust than trying to fix every greeter.
    (LP: #1637758)

 -- Martin Pitt <email address hidden> Tue, 22 Nov 2016 09:43:39 +0100

Changed in lightdm (Ubuntu):
status: Fix Committed → Fix Released
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.