logind flags wrong session as active
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | systemd (Ubuntu) |
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
| Sebastien Bacher (seb128) wrote : | #1 |
| Sebastien Bacher (seb128) wrote : | #2 |
| Sebastien Bacher (seb128) wrote : | #3 |
| Martin Pitt (pitti) wrote : | #4 |
| Changed in systemd (Ubuntu): | |
| assignee: | nobody → Martin Pitt (pitti) |
| importance: | Undecided → Medium |
| status: | New → Triaged |
| Changed in systemd (Ubuntu): | |
| status: | Triaged → In Progress |
| Martin Pitt (pitti) wrote : | #5 |
| Changed in systemd (Ubuntu): | |
| status: | In Progress → Fix Committed |
| Launchpad Janitor (janitor) wrote : | #6 |
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
/
- 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/
dependencies to "lvm2" which is handled with udev rules in Ubuntu.
- Provide shutdown fallback for upstart. (LP: #1370329)
- debian/
really support "allow-hotplug" in Ubuntu at the moment, so we need to
deal with "auto" devices appearing after "/etc/init.
already ran. (LP: #1374521)
- ifup@.service: Drop dependency on networking.service (i. e.
/
This avoids unnecessary dependencies/
cycles if hooks wait for other interfaces to come up (like ifenslave
with bonding interfaces). (LP: #1414544)
- Add Get-RTC-
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
unreprodu
Upgrade fixes, keep until 16.04 LTS release:
- systemd Conflicts/
- Remove obsolete systemd-logind upstart job.
- Clean up obsolete /etc/udev/
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-
--with-
* debian/
described in manpages. Only keep the Debian specific bits.
(Part of #776546)
* Actually install udev's RE...
| Changed in systemd (Ubuntu): | |
| status: | Fix Committed → Fix Released |


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.