Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 669632 - net-misc/networkmanager[iwd] won't find wifi networks if iwd hasn't been started before
Summary: net-misc/networkmanager[iwd] won't find wifi networks if iwd hasn't been star...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Ben Kohler
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-25 20:42 UTC by vltg0903
Modified: 2020-01-24 15:29 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vltg0903 2018-10-25 20:42:10 UTC
I'm seeing some unwanted behaviour from NetworkManager in conjunction with iwd: If iwd starts after NetworkManager (as might and did happen on a freshly installed, fast laptop), the latter won't pick up the wifi networks iwd finds. Restarting NetworkManager fixes this, and a workaround to avoid it happening in the first place is adding the line 'before net' to the depend() function in '/etc/init.d/iwd'.

Versions:

=net-wireless/iwd-0.10
=net-misc/networkmanager-1.14.4
Comment 1 Ben Kohler gentoo-dev 2018-10-25 20:49:49 UTC
I'm working with upstream on this as we speak to find out why this ordering matters, there may be a bug in iwd or NM itself.  This is happening on systemd boot as well.
Comment 2 David Heidelberg (okias) 2019-01-24 11:48:26 UTC
Any progress? I know that iwd is not yet widely used, but would be nice to have it working without restarting NM everytime.
Comment 3 David Heidelberg (okias) 2019-01-24 11:50:01 UTC
also, still present in


iwd 0.14
networkmanager 1.15.1
Comment 4 vltg0903 2019-05-26 15:52:50 UTC
Bug seems to have been resolved upstream as of openrc-0.42.1 + networkmanager-1.16.0 + iwd-0.18
Comment 5 Johannes Willem (Hans) Fernhout 2019-07-28 20:10:32 UTC
Starting with version 0.18 iwd is actively managing network interfaces. It will destroy the wireless interfaces detected by (e)udev, and create new ones. The new ones do not comply to predictable network interface naming convention, but will have an 'old fashioned' kernel name like wlan0. See for details here: https://iwd.wiki.kernel.org/interface_lifecycle. 

I could imagine that if NetworkManager starts before iwd, that it will detect an interface named wlp2s0, but then when iwd starts wlp2s0 will be destroyed and a new one called wlan0 will be created.
There seems to commandline and configuration options to prevent iwd from doing this, but I have not got that working.
Comment 6 Matt Turner gentoo-dev 2019-10-19 19:36:15 UTC
Ben, what's the latest on this? Presumably something's happened in the last year :)
Comment 7 Ben Kohler gentoo-dev 2019-10-25 02:21:02 UTC
This still seems broken but I'll get with usptream on it again
Comment 8 Joakim Tjernlund 2019-11-12 13:44:59 UTC
(In reply to hfern from comment #5)
> Starting with version 0.18 iwd is actively managing network interfaces. It
> will destroy the wireless interfaces detected by (e)udev, and create new
> ones. The new ones do not comply to predictable network interface naming
> convention, but will have an 'old fashioned' kernel name like wlan0. See for
> details here: https://iwd.wiki.kernel.org/interface_lifecycle. 
> 
> I could imagine that if NetworkManager starts before iwd, that it will
> detect an interface named wlp2s0, but then when iwd starts wlp2s0 will be
> destroyed and a new one called wlan0 will be created.
> There seems to commandline and configuration options to prevent iwd from
> doing this, but I have not got that working.

I hope the "old fashioned " I/F names will still work whne this bug is resolved?
Comment 9 Joakim Tjernlund 2019-11-24 19:12:58 UTC
(In reply to Ben Kohler from comment #7)
> This still seems broken but I'll get with usptream on it again

To get around this and possibly improving iwd in general,
in wpa_supplicant openrc script there is:
	after bootmisc modules
	before dns dhcpcd net
Adding the same to iwd makes it start before NM
Comment 10 Joakim Tjernlund 2019-12-17 16:14:45 UTC
Seems to be fixed upstream, see
 https://bugs.gentoo.org/702900

However, I still think iwd should add the same openrc deps as wpa_supplicant
Not everyone is using NM with iwd.
Comment 11 Joakim Tjernlund 2020-01-19 19:44:30 UTC
(In reply to Joakim Tjernlund from comment #9)
> (In reply to Ben Kohler from comment #7)
> > This still seems broken but I'll get with usptream on it again
> 
> To get around this and possibly improving iwd in general,
> in wpa_supplicant openrc script there is:
> 	after bootmisc modules
> 	before dns dhcpcd net
> Adding the same to iwd makes it start before NM

Ping? iwd's openrc deps needs some love.
Comment 12 Ben Kohler gentoo-dev 2020-01-20 13:50:09 UTC
I've not done much testing with this change, do you know of any downside or consequences to this?

I can apply it but I'm trying to stay ahead of extra bug reports that may come in after that change.
Comment 13 Larry the Git Cow gentoo-dev 2020-01-24 15:05:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50a1101f3c952f5086171aaf188ce09033f38f7f

commit 50a1101f3c952f5086171aaf188ce09033f38f7f
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2020-01-24 15:05:03 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2020-01-24 15:05:17 +0000

    net-wireless/iwd: revise init script to fix NM startup
    
    Closes: https://bugs.gentoo.org/669632
    Package-Manager: Portage-2.3.85, Repoman-2.3.20
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 net-wireless/iwd/files/iwd.initd-r1 |  14 ++++
 net-wireless/iwd/iwd-1.4-r1.ebuild  | 153 ++++++++++++++++++++++++++++++++++++
 net-wireless/iwd/iwd-9999.ebuild    |   4 +-
 3 files changed, 169 insertions(+), 2 deletions(-)
Comment 14 Joakim Tjernlund 2020-01-24 15:21:11 UTC
Thanks, no I don't see any down sides.
Comment 15 Joakim Tjernlund 2020-01-24 15:27:37 UTC
(In reply to Larry the Git Cow from comment #13)
> The bug has been closed via the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=50a1101f3c952f5086171aaf188ce09033f38f7f
> 
> commit 50a1101f3c952f5086171aaf188ce09033f38f7f
> Author:     Ben Kohler <bkohler@gentoo.org>
> AuthorDate: 2020-01-24 15:05:03 +0000
> Commit:     Ben Kohler <bkohler@gentoo.org>
> CommitDate: 2020-01-24 15:05:17 +0000
> 
>     net-wireless/iwd: revise init script to fix NM startup

To be clear, this really fixes the iwd service startup to
take place early, before NM.
Adding iwd to default service level then fixes to NM hang
as now iwd starts before NM.

The standalone case is also improved, iwd starts earlier to
be ready, just like wpa_supplicant would.
Comment 16 Joakim Tjernlund 2020-01-24 15:29:55 UTC
(In reply to Joakim Tjernlund from comment #15)
> (In reply to Larry the Git Cow from comment #13)
> > The bug has been closed via the following commit(s):
> > 
> > https://gitweb.gentoo.org/repo/gentoo.git/commit/
> > ?id=50a1101f3c952f5086171aaf188ce09033f38f7f
> > 
> > commit 50a1101f3c952f5086171aaf188ce09033f38f7f
> > Author:     Ben Kohler <bkohler@gentoo.org>
> > AuthorDate: 2020-01-24 15:05:03 +0000
> > Commit:     Ben Kohler <bkohler@gentoo.org>
> > CommitDate: 2020-01-24 15:05:17 +0000
> > 
> >     net-wireless/iwd: revise init script to fix NM startup
> 
> To be clear, this really fixes the iwd service startup to
> take place early, before NM.
> Adding iwd to default service level then fixes to NM hang
> as now iwd starts before NM.
> 
> The standalone case is also improved, iwd starts earlier to
> be ready, just like wpa_supplicant would.

Oh, and perhaps an "empty" conf.d file should be added ?