Skip to content

Commit c52fb76

Browse files
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
1 parent f033cbe commit c52fb76

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

dockers/docker-orchagent/supervisord.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ stdout_logfile=syslog
6161
stderr_logfile=syslog
6262

6363
[program:arp_update]
64-
command=bash -c "/usr/bin/arp_update; sleep 300"
64+
command=/usr/bin/arp_update
6565
priority=8
6666
autostart=false
67-
autorestart=true
67+
autorestart=unexpected
6868
stdout_logfile=syslog
6969
stderr_logfile=syslog
7070

files/scripts/arp_update

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
# arp_update: Send gratuitous ARP requests to VLAN member neighbors to refresh
55
# the neighbors state.
66

7-
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
8-
for vlan in $VLAN; do
9-
# generate a list of arping commands:
10-
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 1>;
11-
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 2>;
12-
# ...
13-
arpingcmd="sed -e 's/ / -i /' -e 's/^/arping -q -w 0 -c 1 /' -e 's/$/;/'"
14-
ipcmd="ip -4 neigh show | grep $vlan | cut -d ' ' -f 1,3 | $arpingcmd"
7+
while /bin/true; do
8+
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
9+
for vlan in $VLAN; do
10+
# generate a list of arping commands:
11+
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 1>;
12+
# arping -q -w 0 -c 1 -i <VLAN interface> <IP 2>;
13+
# ...
14+
arpingcmd="sed -e 's/ / -i /' -e 's/^/arping -q -w 0 -c 1 /' -e 's/$/;/'"
15+
ipcmd="ip -4 neigh show | grep $vlan | cut -d ' ' -f 1,3 | $arpingcmd"
1516

16-
eval `eval $ipcmd`
17+
eval `eval $ipcmd`
18+
done
19+
sleep 300
1720
done

platform/p4/docker-sonic-p4/supervisord.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ stdout_logfile=syslog
133133
stderr_logfile=syslog
134134

135135
[program:arp_update]
136-
command=bash -c "/usr/bin/arp_update; sleep 300"
136+
command=/usr/bin/arp_update
137137
priority=15
138138
autostart=false
139-
autorestart=true
139+
autorestart=unexpected
140140
stdout_logfile=syslog
141141
stderr_logfile=syslog

platform/vs/docker-sonic-vs/supervisord.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ stdout_logfile=syslog
116116
stderr_logfile=syslog
117117

118118
[program:arp_update]
119-
command=bash -c "/usr/bin/arp_update; sleep 300"
119+
command=/usr/bin/arp_update
120120
priority=15
121121
autostart=false
122-
autorestart=true
122+
autorestart=unexpected
123123
stdout_logfile=syslog
124124
stderr_logfile=syslog
125125

0 commit comments

Comments
 (0)