mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
net/mwan3: send SIGKILL to mwan3track
In some situation it is not enough to send a SIGTERM to mwan3track to ask service to stop accurate. If this does not work send him a SIGKILL to prevent mwan3track running more then once per interface. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
@@ -446,7 +446,7 @@ mwan3_delete_iface_ipset_entries()
|
||||
|
||||
mwan3_track()
|
||||
{
|
||||
local track_ip track_ips
|
||||
local track_ip track_ips pid
|
||||
|
||||
mwan3_list_track_ips()
|
||||
{
|
||||
@@ -454,7 +454,11 @@ mwan3_track()
|
||||
}
|
||||
config_list_foreach $1 track_ip mwan3_list_track_ips
|
||||
|
||||
kill $(pgrep -f "mwan3track $1 $2") &> /dev/null
|
||||
for pid in $(pgrep -f "mwan3track $1 $2"); do
|
||||
kill -TERM "$pid" > /dev/null 2>&1
|
||||
sleep 1
|
||||
kill -KILL "$pid" > /dev/null 2>&1
|
||||
done
|
||||
if [ -n "$track_ips" ]; then
|
||||
[ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track "$1" "$2" "$3" "$4" $track_ips &
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user