Skip to content
Merged
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