wifi-presence
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
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
something to do with ujail
Temporary solution, delete or move /etc/capabilities/wpad.json file: root@OpenWrt:~# mv /etc/capabilities/wpad.json ./
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.
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
I have the same issue
Seems like this issue is fixed in the latest version(0.3.0)
Even at 0.3.0 I had to do the procd_set_param user network
trick in /etc/init.d/wifi-presence