network-manager may start before libsystemd-logind

Bug #1400205 reported by Brian Bloniarz
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When NetworkManager starts, it requests systemd login-monitor notifications through the libsystemd-login sd_login_monitor_new(3) API.

This API will fail if the systemd-logind service has not been started, since it directly accesses directories in /run/systemd. As far as I can tell, systemd-logind in Utopic is started on-demand (through DBUS service activation). So, there's no guarantee that it has been started at the point during boot when NetworkMonitor is started. I attached a patch to upstart .conf file with one way to fix it -- it contacts the DBUS logind API within pre-start to ensure it has been started.

NOTE: you will not see the error in syslog -- NetworkManager logs it to stderr which is /dev/null. If you enable --no-daemon on NetworkManager, the error ("sd_login_monitor_new failed") should get logged to /var/log/upstart/network-manager.log. NOTE: even with this fix, I saw that sd_login_monitor_new failed -- I believe that's a bug in Utopic's systemd (https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1400203). I had to patch both to resolve a suspend/resume issue for me.

Seen on:
Ubuntu 14.10
NetworkManager 0.9.8.8-0ubuntu28
libsystemd-login0 208-8ubuntu8

Tags: patch
Revision history for this message
Brian Bloniarz (brianbloniarz) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in network-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "network-manager-logind.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
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
Brian Bloniarz (brianbloniarz) wrote :

Yes - have a look at the network-manager-logind.patch that's attached to this bug. That can be applied directly to /etc/init/network-manager.conf, it just adds a pre-start section to the init script.

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.