mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
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:
committed by
Florian Eckert
parent
bec7a1086f
commit
59d12598b5
@@ -3,11 +3,12 @@
|
||||
[ -f "/etc/mwan3.user" ] && {
|
||||
. /lib/functions.sh
|
||||
. /lib/mwan3/mwan3.sh
|
||||
initscript=/etc/init.d/mwan3
|
||||
. /lib/functions/procd.sh
|
||||
|
||||
[ "$MWAN3_SHUTDOWN" != 1 ] && mwan3_lock "$ACTION" "$DEVICE-user"
|
||||
[ "$MWAN3_SHUTDOWN" != 1 ] && procd_lock
|
||||
|
||||
[ "$MWAN3_SHUTDOWN" != 1 ] && ! /etc/init.d/mwan3 running && {
|
||||
mwan3_unlock "$ACTION" "$DEVICE-user"
|
||||
exit 0
|
||||
}
|
||||
|
||||
@@ -19,8 +20,6 @@
|
||||
exit 0
|
||||
}
|
||||
|
||||
[ "$MWAN3_SHUTDOWN" != 1 ] && mwan3_unlock "$ACTION" "$DEVICE-user"
|
||||
|
||||
env -i ACTION="$ACTION" INTERFACE="$INTERFACE" DEVICE="$DEVICE" \
|
||||
/bin/sh /etc/mwan3.user
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user