libsystemd-login sd_login_monitor_new not working

Bug #1400203 reported by Brian Bloniarz
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
High
Martin Pitt
Utopic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
The systemd login monitoring library (API: sd_login_monitor_new(3)) is not
functional in Utopic. This library is a dependency in NetworkManager, for
tracking user sessions. As a result, my laptop does not reconnect to
the network after a suspend/resume cycle.

There was a patch to fix this in the older, Trusty Tahr version of systemd
(http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/systemd/trusty/view/head:/debian/patches/login-monitor-no-machine.patch).
The patch isn't in the utopic systemd (208-8ubuntu8).

This was discovered in a Gnome Fallback session, but I think this KDE issue
may be the same thing: https://bugs.kde.org/show_bug.cgi?id=340568
Note: This behavior is only seen when "All users may connect to this
network" is un-selected in NetworkManager.
NOTE: in order to get a fully working network, I also had to make a
change to the upstart script, see:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1400205

[Test Case]
A short C program to demonstrate sd_login_monitor_new is attached to the
bug, to demonstrate whether sd_login_monitor_new() is working.

To do an end-to-end test, you can stop NetworkManager, re-run it with
"NetworkManager --no-daemon", and look for the "Error getting login
monitor:" error message.

[Regression Potential]
Fixing this simply means applying a patch which shipped along with
Trusty Tahr's systemd. Since it was widely used already, adding it to
Utopic does not appear overly risky.

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

Hey Brian; would you mind actually attaching your demonstration C program?

Revision history for this message
Brian Bloniarz (brianbloniarz) wrote :

Whoops, done!

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

Confirmed, thanks!

Changed in systemd (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in Debian packaging git with an autopkgtest.

Changed in systemd (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 218-2ubuntu3

---------------
systemd (218-2ubuntu3) vivid; urgency=medium

  * core-Put-session-scopes-into-all-cgroup-controllers.patch: Revert upstream
    commit 02ba8fb3357d to fix eternal kernel deep sleep hangs when unmounting
    an ntfs-3g partition. (LP: #1398859)
 -- Martin Pitt <email address hidden> Thu, 18 Dec 2014 13:32:49 +0100

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Mark (mark-wege) wrote :

Is there an easy to apply this fix for a normal user, so that I don't have to wait until Ubuntu does this?

Revision history for this message
Martin Pitt (pitti) wrote :
Changed in systemd (Ubuntu Utopic):
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Can you please add a proper impact description that justifies that SRU, and would you be willing to test the update in -proposed?

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

I uploaded the fix to the SRU review queue.

Changed in systemd (Ubuntu Utopic):
status: Triaged → In Progress
Revision history for this message
Brian Bloniarz (brianbloniarz) wrote : Re: [Bug 1400203] Re: libsystemd-login sd_login_monitor_new not working

Sure will add description ASAP, and yes I'm happy to test.
On Dec 23, 2014 6:45 AM, "Martin Pitt" <email address hidden> wrote:

> Can you please add a proper impact description that justifies that SRU,
> and would you be willing to test the update in -proposed?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1400203
>
> Title:
> libsystemd-login sd_login_monitor_new not working
>
> Status in systemd package in Ubuntu:
> Fix Released
> Status in systemd source package in Utopic:
> Triaged
>
> Bug description:
> There is a C API in libsystemd-login for receiving notifications, see
> sd_login_monitor_new(3). It is not working in the Utopic version of
> systemd, because it attempts to access /run/systemd/machines which
> does not exist on utopic.
>
> I see a patch to fix this in the older, Trusty Tahr version of systemd
> (http://bazaar.launchpad.net/~ubuntu-
> branches/ubuntu/trusty/systemd/trusty/view/head:/debian/patches/login-
> monitor-no-machine.patch). The patch isn't in the utopic systemd
> (208-8ubuntu8).
>
> I tracked down an issue in NetworkManager which I believe was due to
> this issue. Attached is a C program to demonstrate.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1400203/+subscriptions
>

Revision history for this message
Brian Bloniarz (brianbloniarz) wrote :

@mark: I put up a PPA with the fix, if you'd like to test that: https://launchpad.net/~brianbloniarz/+archive/ubuntu/systemd-1400203

Revision history for this message
Brian Bloniarz (brianbloniarz) wrote :

Apologies for the delay, I updated the bug description with a justification for SRU; let me know if there's anything else I can do to help.

description: updated
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted systemd into utopic-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/systemd/208-8ubuntu8.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemd (Ubuntu Utopic):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [systemd/utopic] possible regression found

As a part of the Stable Release Updates quality process a search for Launchpad bug reports using the version of systemd from utopic-proposed was performed and bug 1408747 was found. Please investigate this bug report to ensure that a regression will not be created by this SRU. In the event that this is not a regression remove the "verification-failed" tag from this bug report and tag 1408747 "bot-stop-nagging". Thanks!

tags: added: verification-failed
Revision history for this message
Brian Bloniarz (brianbloniarz) wrote :

Based on this bug: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1376612 , this is not a regression; the same error occurs in earlier versions of the package too.

tags: added: verification-done
removed: verification-failed verification-needed
Revision history for this message
Brian Bloniarz (brianbloniarz) wrote :

Verified the sd-test.c program, using systemd 208-8ubuntu8.2 in utopic-proposed.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 208-8ubuntu8.2

---------------
systemd (208-8ubuntu8.2) utopic-proposed; urgency=medium

  * build-logind autopkgtest: Re-enforce that sd_login_monitor_new() succeeds,
    and restrict this test to isolation-container. (Reproduces LP #1400203)
  * Bring back patch to make sd_login_monitor_new() work under other init
    systems where /sys/fs/cgroup/systemd/machine does not exist.
    (LP: #1400203)
 -- Martin Pitt <email address hidden> Tue, 23 Dec 2014 20:18:28 +0100

Changed in systemd (Ubuntu Utopic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.