Patchwork NetworkManager doesn't "Connect automatically"

login
register
mail settings
Submitter Chris Marusich
Date Dec. 14, 2016, 9:13 a.m.
Message ID <87eg1a98m6.fsf@gmail.com>
Download mbox | patch
Permalink /patch/18440/
State New
Headers show

Comments

Chris Marusich - Dec. 14, 2016, 9:13 a.m.
Hi Ludo,

ludo@gnu.org (Ludovic Courtès) writes:

> Hello network managers!  :-)

Hopefully soon we will MANAGE to get it working! ;-)

> rennes@openmailbox.org skribis:
>
>> Accordig to what Thomas comments, I have two ideas:
>>
>> * I wil try to compile 'network-manager' with
>> '--with-session-tracking=consolekit'.
>
> On GuixSD we use “elogind”, which is like “systemd-logind”.
>
> However, the build log says:
>
> Platform:
>   session tracking: consolekit
>   suspend/resume: consolekit
>
> … which is definitely wrong.
>
> We need to tell it to use elogind, but adding it as an input is not
> enough.  Ideas?

By running "./configure --help", I found these promising options:

--8<---------------cut here---------------start------------->8---
  --with-systemd-logind=yes|no
                          Support systemd session tracking
  --with-consolekit=yes|no
                          Support consolekit session tracking
--8<---------------cut here---------------end--------------->8---

I tried the attached patch, but when I built network-manager, I got:

--8<---------------cut here---------------start------------->8---
checking for SYSTEMD_200... no
checking for LIBSYSTEMD... no
checking for SYSTEMD_JOURNAL... no
checking for SYSTEMD_JOURNAL... no
checking for SYSTEMD_LOGIN... no
checking for SYSTEMD_LOGIN... no
configure: error: You must have libsystemd installed to build with systemd-logind support.
phase `configure' failed after 5.3 seconds
builder for `/gnu/store/2zv14p720wfw594g86sf8wsd6fmkh8s7-network-manager-1.4.2.drv' failed with exit code 1
@ build-failed /gnu/store/2zv14p720wfw594g86sf8wsd6fmkh8s7-network-manager-1.4.2.drv - 1 builder for `/gnu/store/2zv14p720wfw594g86sf8wsd6fmkh8s7-network-manager-1.4.2.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/2zv14p720wfw594g86sf8wsd6fmkh8s7-network-manager-1.4.2.drv' failed
--8<---------------cut here---------------end--------------->8---

Did I make a mistake, or does NetworkManager just not recognize elogind?
I'll look into this more, but unless I made a mistake, I suspect that
either elogind or network-manager might require some tweaks to convince
network-manager that elogind is equivalent to systemd in this case.
Andy Wingo - Dec. 14, 2016, 9:20 a.m.
On Wed 14 Dec 2016 10:13, Chris Marusich <cmmarusich@gmail.com> writes:

> Did I make a mistake, or does NetworkManager just not recognize elogind?
> I'll look into this more, but unless I made a mistake, I suspect that
> either elogind or network-manager might require some tweaks to convince
> network-manager that elogind is equivalent to systemd in this case.

See README where it mentions differences to logind:

  https://github.com/elogind/elogind

In particular see the changes in gnu/packages/polkit.scm to get
PolicyKit to recognize elogind.

ANdy
Chris Marusich - Dec. 14, 2016, 10:06 a.m.
Andy Wingo <wingo@igalia.com> writes:

> On Wed 14 Dec 2016 10:13, Chris Marusich <cmmarusich@gmail.com> writes:
>
>> Did I make a mistake, or does NetworkManager just not recognize elogind?
>> I'll look into this more, but unless I made a mistake, I suspect that
>> either elogind or network-manager might require some tweaks to convince
>> network-manager that elogind is equivalent to systemd in this case.
>
> See README where it mentions differences to logind:
>
>   https://github.com/elogind/elogind
>
> In particular see the changes in gnu/packages/polkit.scm to get
> PolicyKit to recognize elogind.
>
> ANdy

Awesome, thank you for the tip!  At first blush it looks like the word
"systemd" is mentioned in surprisingly many files inside the
NetworkManager source.  I'll try following the example of polkit and see
how it goes!
Chris Marusich - Dec. 15, 2016, 7:16 a.m.
Chris Marusich <cmmarusich@gmail.com> writes:

> Andy Wingo <wingo@igalia.com> writes:
>
>> On Wed 14 Dec 2016 10:13, Chris Marusich <cmmarusich@gmail.com> writes:
>>
>>> Did I make a mistake, or does NetworkManager just not recognize elogind?
>>> I'll look into this more, but unless I made a mistake, I suspect that
>>> either elogind or network-manager might require some tweaks to convince
>>> network-manager that elogind is equivalent to systemd in this case.
>>
>> See README where it mentions differences to logind:
>>
>>   https://github.com/elogind/elogind
>>
>> In particular see the changes in gnu/packages/polkit.scm to get
>> PolicyKit to recognize elogind.
>>
>> ANdy
>
> Awesome, thank you for the tip!  At first blush it looks like the word
> "systemd" is mentioned in surprisingly many files inside the
> NetworkManager source.  I'll try following the example of polkit and see
> how it goes!

Upon closer inspection, it looks almost as if NetworkManager has
extracted code from systemd for its own internal use.  I'll continue to
look into this, but I don't expect to be able to make progress on my own
very soon, so if someone else wants to dive in and help figure out what
substitutions to make in the NetworkManager code, it would be welcome.

Patch

From 2c3973f566a889e291555a208813f45a371134b7 Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarusich@gmail.com>
Date: Wed, 14 Dec 2016 00:44:54 -0800
Subject: [PATCH] gnome: Enable session tracking in network-manager.

* gnu/packages/gnome.scm (network-manager): Add configuration options
  "--with-systemd-logind=yes" (so we can use elogind to track login sessions)
  and "--with-consolekit=no" (so we don't use consolekit to track sessions,
  since it isn't packaged yet).  Add elogind as an input.
---
 gnu/packages/gnome.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 1762381cf..c2b4f0ce4 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -4409,7 +4409,9 @@  users.")
              (doc      (assoc-ref %outputs "doc"))
              (dhclient (string-append (assoc-ref %build-inputs "isc-dhcp")
                                       "/sbin/dhclient")))
-         (list "--with-crypto=gnutls"
+         (list "--with-systemd-logind=yes" ; In Guix, this is provided via elogind.
+               "--with-consolekit=no" ; We haven't packaged consolekit yet.
+               "--with-crypto=gnutls"
                "--disable-config-plugin-ibft"
                "--sysconfdir=/etc"
                "--localstatedir=/var"
@@ -4474,7 +4476,8 @@  users.")
        ("polkit" ,polkit)
        ("ppp" ,ppp)
        ("readline" ,readline)
-       ("util-linux" ,util-linux)))
+       ("util-linux" ,util-linux)
+       ("elogind" ,elogind)))
     (synopsis "Network connection manager")
     (home-page "http://www.gnome.org/projects/NetworkManager/")
     (description
-- 
2.11.0