Skip to content

Commit

Permalink
Convert arp_update into a 'start-it-once' mode (#1864)
Browse files Browse the repository at this point in the history
* Run arp_update just once, don't restart it. It will run continuosly with 5 min pauses
  • Loading branch information
pavel-shirshov authored Jul 18, 2018
1 parent f033cbe commit c52fb76
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions dockers/docker-orchagent/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ stdout_logfile=syslog
stderr_logfile=syslog

[program:arp_update]
command=bash -c "/usr/bin/arp_update; sleep 300"
command=/usr/bin/arp_update
priority=8
autostart=false
autorestart=true
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog

Expand Down
21 changes: 12 additions & 9 deletions files/scripts/arp_update
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
# arp_update: Send gratuitous ARP requests to VLAN member neighbors to refresh
# the neighbors state.

VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
for vlan in $VLAN; do
# generate a list of arping commands:
# 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"
while /bin/true; do
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
for vlan in $VLAN; do
# generate a list of arping commands:
# 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"

eval `eval $ipcmd`
eval `eval $ipcmd`
done
sleep 300
done
4 changes: 2 additions & 2 deletions platform/p4/docker-sonic-p4/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ stdout_logfile=syslog
stderr_logfile=syslog

[program:arp_update]
command=bash -c "/usr/bin/arp_update; sleep 300"
command=/usr/bin/arp_update
priority=15
autostart=false
autorestart=true
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog
4 changes: 2 additions & 2 deletions platform/vs/docker-sonic-vs/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ stdout_logfile=syslog
stderr_logfile=syslog

[program:arp_update]
command=bash -c "/usr/bin/arp_update; sleep 300"
command=/usr/bin/arp_update
priority=15
autostart=false
autorestart=true
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog

Expand Down

0 comments on commit c52fb76

Please sign in to comment.