logind flags wrong session as active

Bug #1415104 reported by Sebastien Bacher
16
This bug affects 16 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

In vivid I'm regularly running in an issue where, after an upgrade, logind considers my current session as not-active (resulting in unwanted polkit prompt for common actions in the session)

I've updated my system using update-manager and restarted my session (logout to unity-greeter and back in)

loginctl list-sessions lists 2 sessions for my user, an old one with hanging chromium processes, which is flagged as active, and my current one marked as active = no

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

This is quite easy to reproduce indeed:

 * Start computer/VM, log in; session c1 (with autologin) or c2 (with manual login) should be the active one.
 * Log out and back in; now c1 should be in state "closing", assuming that there is still some leftover process in it. In my case that's "pulseaudio" (in Seb's case there was some more cruft). The status is still right, c1 is closing, c3 is active.
 * sudo systemctl restart systemd-logind; now c1 becomes "active yes/opening", and c3 is "active no/online".

I guess logind sets the status of all existing sessions at startup (which makes sense), and since both sessions have the same VT/Display it probably just considers the first matching one as active.

Changed in systemd (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Medium
status: New → Triaged
Martin Pitt (pitti)
Changed in systemd (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in systemd (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.8 KiB)

This bug was fixed in the package systemd - 218-7ubuntu1

---------------
systemd (218-7ubuntu1) vivid; urgency=medium

  * Merge with Debian unstable. Remaining Ubuntu changes:
    - Hack to support system-image read-only /etc, and modify files in
      /etc/writable/ instead.
    - Keep our much simpler udev maintainer scripts (all platforms must
      support udev, no debconf).
    - initramfs init-top: Drop $ROOTDELAY, we do that in a more sensible way
      with wait-for-root. Will get applicable to Debian once Debian gets
      wait-for-root in initramfs-tools.
    - initramfs init-bottom: If LVM is installed, settle udev,
      otherwise we get missing LV symlinks. Workaround for LP #1185394.
    - Add debian/udev.lvm2.init: Dummy SysV init script to satisfy insserv
      dependencies to "lvm2" which is handled with udev rules in Ubuntu.
    - Provide shutdown fallback for upstart. (LP: #1370329)
    - debian/extra/ifup@.service: Additionally run for "auto" class. We don't
      really support "allow-hotplug" in Ubuntu at the moment, so we need to
      deal with "auto" devices appearing after "/etc/init.d/networking start"
      already ran. (LP: #1374521)
    - ifup@.service: Drop dependency on networking.service (i. e.
      /etc/init.d/networking), and merely ensure that /run/network exists.
      This avoids unnecessary dependencies/waiting during boot and dependency
      cycles if hooks wait for other interfaces to come up (like ifenslave
      with bonding interfaces). (LP: #1414544)
    - Add Get-RTC-is-in-local-time-setting-from-etc-default-rc.patch: In
      Ubuntu we currently keep the setting whether the RTC is in local or UTC
      time in /etc/default/rcS "UTC=yes|no", instead of /etc/adjtime.
      (LP: #1377258)
    - Put session scopes into all cgroup controllers. This makes unprivileged
      user LXC containers work under systemd. (LP: #1346734)
    - Lower Breaks: to plymouth version which has the udev inotify fix in
      Ubuntu.
    - Lower libappamor1 dep to the Ubuntu version where it moved to /lib.
    - Make failure of boot-and-services NSpawn.test_boot non-fatal for now.
      This currently fails when being triggered by Jenkins, but is totally
      unreproducible when running this manually on the exact same machine.

    Upgrade fixes, keep until 16.04 LTS release:
    - systemd Conflicts/Replaces/Provides systemd-services.
    - Remove obsolete systemd-logind upstart job.
    - Clean up obsolete /etc/udev/rules.d/README.

systemd (218-7) experimental; urgency=medium

  [ Martin Pitt ]
  * Don't attempt to mount the same swap partition twice through different
    device node aliases. (Closes: #772182, LP: #1399595)
  * logind: handle closing sessions over daemon restarts. (Closes: #759515,
    LP: #1415104)
  * logind: Fix sd_eviocrevoke ioctl call, to make forced input device release
    after log out actually work.
  * debian/rules: Drop obsolete --disable-multi-seat-x and
    --with-firmware-path configure options.
  * debian/udev.README.Debian: Trim the parts which are obsolete, wrong, or
    described in manpages. Only keep the Debian specific bits.
    (Part of #776546)
  * Actually install udev's RE...

Read more...

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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