wifi-presence icon indicating copy to clipboard operation
wifi-presence copied to clipboard

daemon.err wifi-presence[6693]: Error: unable to connect to hostapd control socket "/var/run/hostapd/wlan0": ping error: read error from "PING" command: read unixgram /tmp/wp.wlan0->/var/run/hostapd/wlan0: i/o timeout

Open pablomarquesmendez opened this issue 2 years ago • 7 comments

Hello there

I get this error in the logs when I start wifi-presence:

daemon.err wifi-presence[6693]: Error: unable to connect to hostapd control socket "/var/run/hostapd/wlan0": ping error: read error from "PING" command: read unixgram /tmp/wp.wlan0->/var/run/hostapd/wlan0: i/o timeout

ls -lrt /var/run/hostapd/

srwxrwx--- 1 network network 0 Oct 23 17:45 global srwxrwx--- 1 network network 0 Oct 23 17:45 wlan0 srwxrwx--- 1 network network 0 Oct 23 17:45 wlan1

pablomarquesmendez avatar Oct 24 '22 21:10 pablomarquesmendez

something to do with ujail

pablomarquesmendez avatar Oct 24 '22 21:10 pablomarquesmendez

Temporary solution, delete or move /etc/capabilities/wpad.json file: root@OpenWrt:~# mv /etc/capabilities/wpad.json ./

pablomarquesmendez avatar Nov 06 '22 16:11 pablomarquesmendez

Please try running wifi-presence using ujail with the same configuration options as hostapd.

For example, on my OS I see hostapd being run with these settings:

# ps w | grep hostapd | grep ujail
 1575 root      2656 S    {hostapd} /sbin/ujail -t 5 -n hostapd -U network -G network -C /etc/capabilities/wpad.json -c -- /usr/sbi

I'm then able to run wifi-presence in a similar way:

# /sbin/ujail -U network -G network -C /etc/capabilities/wpad.json -n wifi-presence /tmp/wifi-presence -mqtt.addr=tcp://mosquitto:1883 -verbose=1

Once there's more documentation for ujail I'll work on incorporating this into the run script.

Thanks for the bug report.

awilliams avatar Nov 21 '22 03:11 awilliams

I also ran intro this issue and discovered that simply running the service as the network user solves the problem by adding procd_set_param user network to the init file.

Alternatively, running wifi-presence in a jail with the same capabilities as hostapd also seems to solve the issue:

procd_add_jail fdfd log requirejail
procd_set_param capabilities /etc/capabilities/wpad.json

Ordspilleren avatar Feb 11 '23 20:02 Ordspilleren

I have the same issue

presidentio avatar Mar 07 '23 15:03 presidentio

Seems like this issue is fixed in the latest version(0.3.0)

presidentio avatar Mar 08 '23 08:03 presidentio

Even at 0.3.0 I had to do the procd_set_param user network trick in /etc/init.d/wifi-presence

aiac avatar Aug 18 '23 18:08 aiac