mwan3: use procd for locking everywhere

Replace locks on /var/run/mwan3.lock with locks via procd.

This fixes a deadlock issue where mwan3 stop would have a procd
lock, but a hotplug script would have the /var/run/mwan3.lock

Locking can be removed from mwan3rtmon since:
1) procd will have sent the KILL signal to the process during
shutdown, so it will not add routes to already removed interfaces on
mwan3 shutdown and
2) mwan3rtmon checks if an interface is active based on the
mwan3_iface_in_<IFACE> entry in iptables, and the hotplug script
always adds this before creating the route table and removes it
before deleting the route table

Fixes github issue #13704
(https://github.com/openwrt/packages/issues/13704)
This commit is contained in:
Aaron Goodman
2020-11-05 20:37:37 -05:00
committed by Florian Eckert
parent bec7a1086f
commit 59d12598b5
5 changed files with 9 additions and 35 deletions
-7
View File
@@ -31,8 +31,6 @@ start_service() {
mwan3_init
config_foreach start_tracker interface
mwan3_lock "command" "mwan3"
mwan3_update_iface_to_table
mwan3_set_connected_ipset
mwan3_set_custom_ipset
@@ -43,8 +41,6 @@ start_service() {
mwan3_set_policies_iptables
mwan3_set_user_rules
mwan3_unlock "command" "mwan3"
procd_open_instance rtmon_ipv4
procd_set_param command /usr/sbin/mwan3rtmon ipv4
procd_set_param respawn
@@ -61,8 +57,6 @@ start_service() {
stop_service() {
local ipset rule IP IPTR IPT family table tid
mwan3_lock "command" "mwan3"
config_load mwan3
mwan3_init
config_foreach mwan3_interface_shutdown interface
@@ -108,7 +102,6 @@ stop_service() {
rm -rf $MWAN3_STATUS_DIR $MWAN3TRACK_STATUS_DIR
mwan3_unlock "command" "mwan3"
}
reload_service() {