From 24b97579d20b6ac6df81654a953386d2912fc324 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 5 Dec 2019 18:35:36 +0100 Subject: hostapd: re-introduce process tracking Before commit 60fb4c92b6 ("hostapd: add ubus reload") netifd was tracking hostapd/wpa_supplicant and restarting wifi in case of a process crash. Restore this behaviour by tracking the PIDs of hostapd and wpa_supplicant. Also make sure hostapd and/or wpa_supplicant have been started before emmitting ubus calls to them using ubus wait_for. Signed-off-by: Daniel Golle --- package/network/services/hostapd/files/hostapd.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'package/network') diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index f03b98ff85..4bf6a6c971 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -958,6 +958,7 @@ wpa_supplicant_run() { _wpa_supplicant_common "$ifname" + ubus wait_for wpa_supplicant.$phy ubus call wpa_supplicant.$phy config_add "{ \ \"driver\": \"${_w_driver:-wext}\", \"ctrl\": \"$_rpath\", \ \"iface\": \"$ifname\", \"config\": \"$_config\" \ @@ -969,6 +970,9 @@ wpa_supplicant_run() { [ "$ret" != 0 ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED + local supplicant_pid=$(ubus call service list '{"name": "hostapd"}' | jsonfilter -l 1 -e "@['hostapd'].instances['supplicant-${phy}'].pid") + wireless_add_process "$supplicant_pid" "/usr/sbin/wpa_supplicant" 1 + return $ret } -- cgit v1.2.3