Patchwork NetworkManager doesn't "Connect automatically"

login
register
mail settings
Submitter Chris Marusich
Date Dec. 15, 2016, 10:24 a.m.
Message ID <87mvfxpk0q.fsf@gmail.com>
Download mbox | patch
Permalink /patch/18475/
State New
Headers show

Comments

Chris Marusich - Dec. 15, 2016, 10:24 a.m.
Chris Marusich <cmmarusich@gmail.com> writes:

> 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.

I tried following polkit's example.  These patches enable me to build
network-manager with elogind, but when I reconfigure my system using the
new network-manager package, NetworkManager still fails to automatically
connect (like before, there are no error messages that I can find).

I suspect I didn't replace the right "systemd" references, but it's hard
to say.  A second pair of eyes on this would be very helpful!
Andy Wingo - Dec. 15, 2016, 10:41 a.m.
On Thu 15 Dec 2016 11:24, Chris Marusich <cmmarusich@gmail.com> writes:

> I tried following polkit's example.  These patches enable me to build
> network-manager with elogind, but when I reconfigure my system using the
> new network-manager package, NetworkManager still fails to automatically
> connect (like before, there are no error messages that I can find).
>
> I suspect I didn't replace the right "systemd" references, but it's hard
> to say.  A second pair of eyes on this would be very helpful!

Patches LGTM but I don't have the bandwidth right now to test :)  I
suggest just pushing them and then people with NM can more easily debug
things.

Andy
Ludovic Courtès - Dec. 15, 2016, 3:53 p.m.
Chris Marusich <cmmarusich@gmail.com> skribis:

> I tried following polkit's example.  These patches enable me to build
> network-manager with elogind, but when I reconfigure my system using the
> new network-manager package, NetworkManager still fails to automatically
> connect (like before, there are no error messages that I can find).
>
> I suspect I didn't replace the right "systemd" references, but it's hard
> to say.  A second pair of eyes on this would be very helpful!

[...]

> From 775e0f0c18fb2bcfc297c92184c54e81fb2db79d Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich@gmail.com>
> Date: Wed, 14 Dec 2016 00:44:54 -0800
> Subject: [PATCH 1/2] 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, and add a snippet to
>   replace some references to systemd with elogind.

[...]

> From d6de68789959bd657c5697c717201d5bcdaf2fcf Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich@gmail.com>
> Date: Wed, 14 Dec 2016 00:01:26 -0800
> Subject: [PATCH 2/2] gnome: Enable NetworkManager in gnome-settings-daemon.
>
> * gnu/packages/gnome.scm (gnome-settings-daemon): remove the configure option
>   "--disable-network-manager".  Add network-manager as an input.

Following Andy’s advice I committed both with slightly-tweaked commit
logs.  That’ll give lurkers out there an incentive to give it a try.
;-)

Thank you Chris!

Ludo’.
Chris Marusich - Dec. 17, 2016, 9:33 a.m.
ludo@gnu.org (Ludovic Courtès) writes:

> Following Andy’s advice I committed both with slightly-tweaked commit
> logs.  That’ll give lurkers out there an incentive to give it a try.
> ;-)
>
> Thank you Chris!
>
> Ludo’.

Thank you!  When I find some time, I'll look into modifying the polkit
rules for network manager so that the work-around (make the network
connection available to all users) works without requiring root to have
a password.  In the meantime, at least one can temporarily give root a
password, make the change, and then remove root's password.

Hopefully someone with more NetworkManager experience can help figure
out exactly what to patch to get the elogind support working right.

Patch

From d6de68789959bd657c5697c717201d5bcdaf2fcf Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarusich@gmail.com>
Date: Wed, 14 Dec 2016 00:01:26 -0800
Subject: [PATCH 2/2] gnome: Enable NetworkManager in gnome-settings-daemon.

* gnu/packages/gnome.scm (gnome-settings-daemon): remove the configure option
  "--disable-network-manager".  Add network-manager as an input.
---
 gnu/packages/gnome.scm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 846317f1d..74ccf9e75 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -2648,9 +2648,7 @@  services for numerous locations.")
          "1rvqisrh3lridsb8rvm7spvncyq206ly0245zgpbm8swi5fhfjp8"))))
     (build-system glib-or-gtk-build-system)
     (arguments
-     `(;; Network manager not yet packaged.
-       #:configure-flags '("--disable-network-manager")
-       ;; Color management test can't reach the colord system service.
+     `(;; Color management test can't reach the colord system service.
        #:tests? #f))
     (native-inputs
      `(("pkg-config" ,pkg-config)
@@ -2679,7 +2677,8 @@  services for numerous locations.")
        ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
        ("libwacom" ,libwacom)
        ("librsvg" ,librsvg)
-       ("xf86-input-wacom" ,xf86-input-wacom)))
+       ("xf86-input-wacom" ,xf86-input-wacom)
+       ("network-manager" ,network-manager)))
     (home-page "http://www.gnome.org")
     (synopsis "GNOME settings daemon")
     (description
-- 
2.11.0