Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 607352 - net-misc/networkmanager: Add elogind support
Summary: net-misc/networkmanager: Add elogind support
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
Depends on:
Blocks: elogind-support
  Show dependency tree
Reported: 2017-01-27 00:53 UTC by Martijn Schmidt
Modified: 2019-03-23 12:58 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---

Patch for networkmanager-1.4.4-r1 ebuild (networkmanager_ebuild_enable_elogind.patch,3.23 KB, patch)
2017-02-21 12:58 UTC, Sven Eden
Details | Diff
Patch networkmanager to accept elogind (networkmanager-1.4.4-enable-elogind.patch,7.80 KB, patch)
2017-02-21 13:00 UTC, Sven Eden
Details | Diff
Patch networkmanager-qt to allow networkmanager[elogind] (networkmanager-qt_ebuild_enable_elogind.patch,440 bytes, patch)
2017-02-21 13:01 UTC, Sven Eden
Details | Diff
Update init script to use elogind (networkmanager_update_init.patch,255 bytes, patch)
2017-02-24 08:57 UTC, Sven Eden
Details | Diff
Updated patch to support elogind support (networkmanager-1.4.4-enable-elogind-r1.patch,8.33 KB, patch)
2017-02-25 11:45 UTC, Sven Eden
Details | Diff
networkmanager-1.8.0.ebuild.diff (networkmanager-1.8.0.ebuild.diff,2.93 KB, patch)
2017-05-27 10:52 UTC, Andreas Sturmlechner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martijn Schmidt 2017-01-27 00:53:00 UTC
net-misc/networkmanager uses either consolekit or systemd-logind for session tracking.

Could we please add support for libelogind by adding a new USE flag "elogind" which would patch the source to depend on sys-auth/elogind and allows one to forego both systemd and consolekit?

Admittely, I am not anywhere near an expert but if my search engine skills serve me right then nm-session-monitor.c would be the primary target for patching:

Moreover, GuixSD has already started some work on similar patches according to their mailing list - which might come in useful:
Comment 1 Sven Eden 2017-02-14 08:21:39 UTC
I am working on it.

But I've seen, that kde-frameworks/networkmanager-qt has to be changed to allow elogind, too, as it depends on either
  >=net-misc/networkmanager-1.4.0-r1[consolekit,teamd=] or

It simply needs a line
as a third alternative.
Comment 2 Sven Eden 2017-02-21 12:55:57 UTC
I have come up with the following changes to allow my Plasma system to use networkmanager with elogind.

Please note, that I am *normally* using a dhcpcd-only system. I have therefore changed the ebuild so that USE="-dhclient" results in using dhcpcd.
(Actually if you disable dhclient, the networkmanager configure script will use it anyway although it isn't there, unless told to use dhcpcd.)
Comment 3 Sven Eden 2017-02-21 12:58:04 UTC
Created attachment 464500 [details, diff]
Patch for networkmanager-1.4.4-r1 ebuild

This patch adds USE="elogind" to have networkmanager to use elogind instead of systemd-login.

Further USE="-dhclient" will result in dhcpcd to be used.
Comment 4 Sven Eden 2017-02-21 13:00:30 UTC
Created attachment 464502 [details, diff]
Patch networkmanager to accept elogind

This patch adds --with-session-tracking=elogind support and patches
to make use of elogind.
Comment 5 Sven Eden 2017-02-21 13:01:23 UTC
Created attachment 464504 [details, diff]
Patch networkmanager-qt to allow networkmanager[elogind]

Plasma users need this, or networkmanager-qt insists on either systemd or consolekit.
Comment 6 Mike Gilbert gentoo-dev 2017-02-21 15:04:53 UTC
Please send any relevant patches upstream.
Comment 7 Sven Eden 2017-02-21 15:23:29 UTC
(In reply to Mike Gilbert from comment #6)
> Please send any relevant patches upstream.

Sure! Once they are tested.

Currently NetworkManager works fine with dhcpcd using elogind-225.9999 on my laptop. If it still works fine (So no weird log messages) tonight at home, where it has to deal with wifi, I'll send it upstream tomorrow.
Comment 8 Sven Eden 2017-02-24 08:57:08 UTC
Created attachment 464966 [details, diff]
Update init script to use elogind

I can't believe I forgot to upload that.

The init script already has a
  use consolekit
clause, and when elogind is present, a
  use elogind
clause should help.
Comment 9 Sven Eden 2017-02-24 09:22:39 UTC
Currently I have installed:

- net-misc/networkmanager-1.4.4-r13::seden
- net-misc/dhcpcd-6.11.5
- sys-auth/elogind-225.9999::seden

With this setting all networking work just fine, configured from Plasma using networkmanager-qt.

I have registered with and will propose my patch upstream.
Comment 10 Sven Eden 2017-02-24 09:34:31 UTC
Submitted as bug 779167 (
Comment 11 Sven Eden 2017-02-25 11:42:47 UTC
Elogind support in NetworkManager has been merged:
Comment 12 Sven Eden 2017-02-25 11:45:31 UTC
Created attachment 465102 [details, diff]
Updated patch to support elogind support

This is an updated patch, that adds changes by Thomas Haller <> made to the initial patch.
This is essentially what has been merged into upstream.
Comment 13 Martijn Schmidt 2017-02-25 13:45:48 UTC
I have tested both builds - net-misc/networkmanager-1.4.4-r13 with Sven's original patches and net-misc/networkmanager-1.4.4-r14 with the patches that Thomas committed upstream. Works like a charm, and I have uninstalled ConsoleKit in its entirety. Typically use WiFi, but it also worked hotplugging my TB3-to-TB2 + Apple Thunderbolt 1GbE NIC on the Dell XPS 13 9360.

So, fingers crossed for the next upstream release and hopefully we can then add the elogind USE flag to the in-tree ebuild!
Comment 14 Andreas Sturmlechner gentoo-dev 2017-05-27 10:52:05 UTC
Created attachment 474512 [details, diff]

networkmanager-1.8.0 has upstream elogind support, let's make it available then.
Comment 15 Andreas Sturmlechner gentoo-dev 2017-05-27 15:11:32 UTC
Thanks, net-misc/netorkmanager-1.8.0 added USE=elogind in git commit 17287aa7d5aa639964c529c6ed08f9bcee2e172d
Comment 16 Mart Raudsepp gentoo-dev 2019-03-23 10:23:47 UTC
Why do we have ?? ( consolekit elogind systemd ) (instead of ^^) when the suspend-resume stuff always falls back to at least consolekit in the usex chaining? Upstream has a final fallback to upower instead though
Comment 17 Mike Gilbert gentoo-dev 2019-03-23 12:46:19 UTC
(In reply to Mart Raudsepp from comment #16)

upower was killed by Pacho in bc2837c7ea2af4ebec0629370da94686c2cdf1f7.

There's no option to disable suspend/resume support entirely. The consolekit option requires no external build-time dependencies, so it makes a reasonable default when no other provider is selected. The dbus calls will just fail at runtime.
Comment 18 Mike Gilbert gentoo-dev 2019-03-23 12:48:53 UTC
In other words, it is entirely practical to use networkmanager without consolekit, elogind, and systemd. Please don't add an unnecessary REQUIRED_USE constraint.
Comment 19 Larry the Git Cow gentoo-dev 2019-03-23 12:58:31 UTC
The bug has been closed via the following commit(s):

commit a3d917e57fa37daea47fa0f1e3e4f5027510479d
Author:     Mike Gilbert <>
AuthorDate: 2019-03-23 12:58:06 +0000
Commit:     Mike Gilbert <>
CommitDate: 2019-03-23 12:58:06 +0000

    net-misc/networkmanager: explain consolkit default for suspend/resume
    Package-Manager: Portage-2.3.62_p4, Repoman-2.3.12_p87
    Signed-off-by: Mike Gilbert <>

 net-misc/networkmanager/networkmanager-1.16.0.ebuild | 2 ++
 1 file changed, 2 insertions(+)