Convert arp_update into a 'start-it-once' mode (#1864)
* Run arp_update just once, don't restart it. It will run continuosly with 5 min pauses
This commit is contained in:
parent
f033cbe296
commit
c52fb762dd
@ -61,10 +61,10 @@ stdout_logfile=syslog
|
|||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
|
||||||
[program:arp_update]
|
[program:arp_update]
|
||||||
command=bash -c "/usr/bin/arp_update; sleep 300"
|
command=/usr/bin/arp_update
|
||||||
priority=8
|
priority=8
|
||||||
autostart=false
|
autostart=false
|
||||||
autorestart=true
|
autorestart=unexpected
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
|
||||||
|
@ -4,14 +4,17 @@
|
|||||||
# arp_update: Send gratuitous ARP requests to VLAN member neighbors to refresh
|
# arp_update: Send gratuitous ARP requests to VLAN member neighbors to refresh
|
||||||
# the neighbors state.
|
# the neighbors state.
|
||||||
|
|
||||||
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
|
while /bin/true; do
|
||||||
for vlan in $VLAN; do
|
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
|
||||||
# generate a list of arping commands:
|
for vlan in $VLAN; do
|
||||||
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 1>;
|
# generate a list of arping commands:
|
||||||
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 2>;
|
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 1>;
|
||||||
# ...
|
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 2>;
|
||||||
arpingcmd="sed -e 's/ / -i /' -e 's/^/arping -q -w 0 -c 1 /' -e 's/$/;/'"
|
# ...
|
||||||
ipcmd="ip -4 neigh show | grep $vlan | cut -d ' ' -f 1,3 | $arpingcmd"
|
arpingcmd="sed -e 's/ / -i /' -e 's/^/arping -q -w 0 -c 1 /' -e 's/$/;/'"
|
||||||
|
ipcmd="ip -4 neigh show | grep $vlan | cut -d ' ' -f 1,3 | $arpingcmd"
|
||||||
|
|
||||||
eval `eval $ipcmd`
|
eval `eval $ipcmd`
|
||||||
|
done
|
||||||
|
sleep 300
|
||||||
done
|
done
|
||||||
|
@ -133,9 +133,9 @@ stdout_logfile=syslog
|
|||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
|
||||||
[program:arp_update]
|
[program:arp_update]
|
||||||
command=bash -c "/usr/bin/arp_update; sleep 300"
|
command=/usr/bin/arp_update
|
||||||
priority=15
|
priority=15
|
||||||
autostart=false
|
autostart=false
|
||||||
autorestart=true
|
autorestart=unexpected
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
@ -116,10 +116,10 @@ stdout_logfile=syslog
|
|||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
|
||||||
[program:arp_update]
|
[program:arp_update]
|
||||||
command=bash -c "/usr/bin/arp_update; sleep 300"
|
command=/usr/bin/arp_update
|
||||||
priority=15
|
priority=15
|
||||||
autostart=false
|
autostart=false
|
||||||
autorestart=true
|
autorestart=unexpected
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user