You are not logged in.

#1 2020-08-11 14:02:35

gearhead
Member
Registered: 2018-03-24
Posts: 56

iwd and resolvconf

Been struggling to get connman/iwd to auto reconnect (no GUI, no NetworkManager) after a router reboot. I have masked systemd-resolved and put in the directive in /etc/iwd/main.conf:
```
[Network]
NameResolvingService=resolved
```
When I do this, I get an error logged in the journal because iwd cannot create the directory /run/resolve
```
iwd[602]: mkdir: cannot create directory '/run/resolvconf': Read-only file system
iwd[601]: Failed to create needed directory /run/resolvconf
```
I tried putting a (hack) line in the iwd.service file:
```
ExecStartPre=/bin/mkdir -p /run/resolvconf
```
but still get the same error. My guess is this is a recent development with systemd, but am a bit confused as to how to resolve it.

Offline

#2 2020-08-11 14:44:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: iwd and resolvconf

The problem is clearly stated, apparently /run is on a readonly filesystem - it should not be.

First, please post the output of the following in code tags (not markdown backticks):

findmnt /run

EDIT: also please post the output from

uname -a

Last edited by Trilby (2020-08-11 14:48:30)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2020-08-20 15:43:31

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: iwd and resolvconf

Hi,

I hope it's OK if I butt in because I'm seeing exactly the same issue :^\

local/iwd 1.8-1
    Internet Wireless Daemon
local/openresolv 3.10.0-1
    resolv.conf management framework (resolvconf)

I'm guessing systemd-resolved works as advertised(???) but I haven't tried that.  openresolv/resolvconf is "old fashioned" and something I'm very familiar with.

$ cat /etc/iwd/main.conf 
[General]
EnableNetworkConfiguration=true

[Network]
NameResolvingService=resolvconf

Should I try disabling EnableNetworkConfiguration and using dhcpcd instead?  That might work... but it doesn't fix the apparent problem between iwd and openresolv....

$ findmnt /run
TARGET SOURCE FSTYPE OPTIONS
/run   run    tmpfs  rw,nosuid,nodev,relatime,mode=755

$ uname -a
Linux blah 5.8.1-arch1-1 #1 SMP PREEMPT Wed, 12 Aug 2020 18:50:43 +0000 x86_64 GNU/Linux

I'm getting other errors; here's my full iwd.service log output:

Aug 20 09:55:02 blah systemd[1]: Starting Wireless service...
Aug 20 09:55:02 blah iwd[1732]: Wireless daemon version 1.8
Aug 20 09:55:02 blah iwd[1732]: Loaded configuration from /etc/iwd/main.conf
Aug 20 09:55:02 blah systemd[1]: Started Wireless service.
Aug 20 09:55:02 blah iwd[1732]: Wiphy: 0, Name: phy0
Aug 20 09:55:02 blah iwd[1732]:         Permanent Address: 00:00:00:00:00:00
Aug 20 09:55:02 blah iwd[1732]:         Bands: 2.4 GHz 5 GHz
Aug 20 09:55:02 blah iwd[1732]:         Ciphers: CCMP TKIP BIP
Aug 20 09:55:02 blah iwd[1732]:         Supported iftypes: ad-hoc station
Aug 20 09:55:02 blah iwd[1732]: DEL_INTERFACE failed: Operation not supported
Aug 20 09:55:02 blah iwd[1732]: Could not register frame watch type 00d0: -95
Aug 20 09:55:02 blah iwd[1732]: Could not register frame watch type 00d0: -95
Aug 20 09:55:02 blah iwd[1732]: Could not register frame watch type 00d0: -95
Aug 20 09:55:02 blah iwd[1732]: Could not register frame watch type 00d0: -95
Aug 20 09:55:02 blah iwd[1732]: Could not register frame watch type 00d0: -95
Aug 20 09:55:02 blah iwd[1732]: Could not register frame watch type 00d0: -95
Aug 20 09:55:02 blah iwd[1732]: Could not register frame watch type 00d0: -95
Aug 20 09:55:03 blah iwd[1745]: mkdir: cannot create directory ‘/run/resolvconf’: Read-only file system
Aug 20 09:55:03 blah iwd[1738]: Failed to create needed directory /run/resolvconf
Aug 20 09:55:03 blah iwd[1732]: resolve: /usr/bin/resolvconf exited with status (256).

I could be totally off base, but I think it's trying to write to /run in the initramfs stage???  Mind you, I have no evidence of this except that after my laptop boots/wireless is working I can

$ sudo mkdir /run/resolvconf
$ ls -la /run/resolvconf
total 0
drwxr-xr-x  2 root root  40 Aug 20 10:52 ./
drwxr-xr-x 19 root root 540 Aug 20 10:52 ../

so after boot /run is certainly not read-only.

This is my first time using iwd.  It seems to work well (only one disconnect hiccup so far that was immediately cured by restarting iwd).  When I use wpa_supplicant with dhcpcd the resolvconf hooks work and /etc/resolv.conf is written correctly.

Thanks for any thoughts or suggestions on this nagging problem :^)  Please tell me what else I can provide.

Clemmitt Sigler

Offline

#4 2020-08-22 14:50:18

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: iwd and resolvconf

cmsigler wrote:

I could be totally off base, but I think it's trying to write to /run in the initramfs stage???

D'oh!  So much to learn about systemd (which I think is excellent despite me being a greybeard :^\).

I should have checked FlySpray before posting my last.  There is a bug report:

https://bugs.archlinux.org/task/67069

So, it seems the correct fix is to edit iwd.service (copied to /etc/systemd/system/) and in the [Service] section add:

RuntimeDirectory=resolvconf
ReadWritePaths=/etc/resolv.conf

then disable/enable iwd.service to get the multi-user.target.wants link to point to this updated service file.

For me, when iwd gets the DNS nameserver it only gets IPv4 addresses.  To also get IPv6 I simply enabled dhcpcd\@wlan0 and started it.  Then /etc/resolv.conf gets written the way I expect (FWIW).

HTH.

Clemmitt

Offline

#5 2020-08-22 14:53:11

cmsigler
Member
Registered: 2013-11-18
Posts: 35

Re: iwd and resolvconf

gearhead wrote:

Been struggling to get connman/iwd to auto reconnect (no GUI, no NetworkManager) after a router reboot.

Hi,

If this fixes your problem, too, please edit the title of this thread as "[Solved]"  TIA :^)

Clemmitt

Offline

#6 2020-09-19 22:14:54

gearhead
Member
Registered: 2018-03-24
Posts: 56

Re: iwd and resolvconf

this does not fix my problem. I always get proper ipv4 and ipv6 addresses, no problem without  any config edits.

I have tried a bunch of things. As best I can tell, iwd works 'just fine' and it is connman that is the problem. What I previously tried was to have connman manage iwd and that resulted in a dropped connection if the router rebooted and it would never reconnect. I tried building the git version of connman and tried that and also the git verison of iwd. What I have seen is that the later versions of connman is a bit more integrated with iwd as 'connmanctl scan wifi' actually causes a scan and not a stall with current git versions of iwd and connman. Still, though, if connman is managing the wifi and the SSID goes away (router reboot, turning off then on of the radio, etc), the connection is dropped and when the radio comes back on, it never reconnects. Ever.

What I have tried that does work is to use systemd-networkd and dhcpcd and iwd. This works as expected, every time. I create a connection and set it to autoconnect and it will always reconnect on a router power cycle. This leads me to believe that connman is the problem, still.

The latest git versions of connman have other issues such as if it connects to wifi, it will not allow an ethernet connection?!? to be made. It will not even connect to the ethernet if it also connects to the wifi. As it is, I am back at the current connman 1.38/iwd. 1.9 but have disabled connman until it can be reliable. As it is, we have changed our UI from netctl to connman, so we are hoping that it matures to the point that it can reliably manage wifi and ethernet.

I do not know if the current connman/iwd yet allow connman to scan wifis with iwd, but the git versions do.

Offline

Board footer

Powered by FluxBB