Re: NetworkManager doesn't "Connect automatically"

2016-12-19 Thread Thomas Haller
On Sat, 2016-12-17 at 01:51 -0800, Chris Marusich wrote:
> Thomas Haller <thal...@redhat.com> writes:
> 
> > On Wed, 2016-12-14 at 01:38 -0800, Chris Marusich wrote:
> > > Hi Thomas,
> > > 
> > > Thank you for the quick response!
> > > 
> > > Thomas Haller <thal...@redhat.com> writes:
> > > 
> > > > Did you build NetworkManager yourself? Is session-tracking
> > > > properly
> > > > enabled to use systemd-logind or consolekit.
> > > 
> > > Yes, I'm building it from source [1].  It looks like we might
> > > need to
> > > adjust the way we build it to enable session-tracking, like
> > > you've
> > > suggested.  Am I correct in understanding that I should only need
> > > to
> > > pass the option "--with-systemd-logind=yes" to the configure
> > > script
> > > to
> > > enable session tracking via systemd-logind?  Is anything else
> > > required?
> > 
> > Hi,
> > 
> > No, that should be enough.
> > 
> > Possibly it was already enabled before, detected automatically?
> > 
> > Thomas
> 
> OK.  Thank you for confirming my understanding.
> 
> In GuixSD, we actually use elogind [1] instead of systemd for session
> tracking.  This requires us to patch the NetworkManager source to use
> elogind instead of systemd libraries.  For example, we do this sort
> of
> patching successfully when packaging polkit [2].
> 
> I tried the same thing with NetworkManager [3], but it didn't quite
> work
> out.  There are a lot of references to systemd in NetworkManager, and
> I
> think I'm just not familiar enough with NetworkManager, systemd, or
> elogind to know for sure what needs to be patched to trick
> NetworkManager into using elogind instead of systemd for session
> management.  For now, we've committed the package definition as-is,
> but
> until somebody figures out exactly how to patch it to work with
> elogind,
> users must use the previously mentioned work-around (make the
> connection
> available to all users) if they want to enable automatic connection.

Hi,

There are very little dependencies of NetworkManager to systemd. Note
that the src/systemd directory contains a self-contained copy of
systemd sources. That is, you don't need an systemd dependency for
those.

Regarding session management, you'd only have to patch
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/nm-session-monitor.c?id=fa15543179aa8ca8e082267121e7df4a131bf642
That seems doable.


Thomas

signature.asc
Description: This is a digitally signed message part


Re: NetworkManager doesn't "Connect automatically"

2016-12-14 Thread Thomas Haller
On Wed, 2016-12-14 at 01:38 -0800, Chris Marusich wrote:
> Hi Thomas,
> 
> Thank you for the quick response!
> 
> Thomas Haller <thal...@redhat.com> writes:
> 
> > Did you build NetworkManager yourself? Is session-tracking properly
> > enabled to use systemd-logind or consolekit.
> 
> Yes, I'm building it from source [1].  It looks like we might need to
> adjust the way we build it to enable session-tracking, like you've
> suggested.  Am I correct in understanding that I should only need to
> pass the option "--with-systemd-logind=yes" to the configure script
> to
> enable session tracking via systemd-logind?  Is anything else
> required?

Hi,

No, that should be enough.

Possibly it was already enabled before, detected automatically?

Thomas

signature.asc
Description: This is a digitally signed message part


Re: NetworkManager doesn't "Connect automatically"

2016-12-13 Thread Thomas Haller
On Mon, 2016-12-12 at 22:51 -0800, Chris Marusich wrote:


Hi,


> * If I check the "Make available to other users" check-box, then
>   NetworkManager DOES automatically connect to my wireless network.
>   However, my understanding is that this is only a workaround, and
> that
>   in fact NetworkManager should automatically connect when "Connect
>   automatically" is checked and "Make available to other users" is
> not
>   checked.  Please correct me if I'm mistaken.

This restricts the connection to a certain user, determined by the
connection.permissions property (see `nmcli connection show $NAME`
and `man nm-settings`).

This makes the connection only available, when a session for that user
exists. Is that user logged-in?

Did you build NetworkManager yourself? Is session-tracking properly
enabled to use systemd-logind or consolekit.



Starting NetworkManager with --debug is usually not that useful. The
most interesting thing it does is to turn on debug-logging, which you
can do  otherwise [1].



best,
Thomas


[1] 
https://cgit.freedesktop.org/NetworkManager/NetworkManager/plain/contrib/fedora/rpm/NetworkManager.conf?id=c90ec2d8c8a12b44c908bf7f80b23059c29f68fa

signature.asc
Description: This is a digitally signed message part