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:
pavel-shirshov 2018-07-18 13:04:57 -07:00 committed by GitHub
parent f033cbe296
commit c52fb762dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 15 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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