Skip to content

Commit 663bf00

Browse files
[swss]: Run tunnel_pkt_handler on dualtor only (#11626)
At SWSS docker init time, check the device subtype and enable tunnel packet handler only if it is dualtor Signed-off-by: Lawrence Lee <[email protected]>
1 parent 8bb3863 commit 663bf00

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

dockers/docker-orchagent/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ RUN apt-get purge -y \
7474

7575
COPY ["files/arp_update", "/usr/bin"]
7676
COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"]
77-
COPY ["ndppd.conf", "/usr/share/sonic/templates/"]
77+
COPY ["ndppd.conf", "tunnel_packet_handler.conf", "/usr/share/sonic/templates/"]
7878
COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"]
7979
COPY ["docker-init.sh", "orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"]
8080
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

dockers/docker-orchagent/docker-init.sh

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CFGGEN_PARAMS=" \
1313
-t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \
1414
"
1515
VLAN=$(sonic-cfggen $CFGGEN_PARAMS)
16+
SUBTYPE=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['subtype']")
1617

1718
chmod +x /usr/bin/wait_for_link.sh
1819

@@ -27,4 +28,8 @@ if [ "$VLAN" != "" ]; then
2728
cp /usr/share/sonic/templates/ndppd.conf /etc/supervisor/conf.d/
2829
fi
2930

31+
if [ "$SUBTYPE" == "DualToR" ]; then
32+
cp /usr/share/sonic/templates/tunnel_packet_handler.conf /etc/supervisor/conf.d/
33+
fi
34+
3035
exec /usr/local/bin/supervisord

dockers/docker-orchagent/supervisord.conf

-10
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,3 @@ stdout_logfile=syslog
205205
stderr_logfile=syslog
206206
dependent_startup=true
207207
dependent_startup_wait_for=swssconfig:exited
208-
209-
[program:tunnel_packet_handler]
210-
command=/usr/bin/tunnel_packet_handler.py
211-
priority=12
212-
autostart=false
213-
autorestart=unexpected
214-
stdout_logfile=syslog
215-
stderr_logfile=syslog
216-
dependent_startup=true
217-
dependent_startup_wait_for=swssconfig:exited
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[program:tunnel_packet_handler]
2+
command=/usr/bin/tunnel_packet_handler.py
3+
priority=12
4+
autostart=false
5+
autorestart=unexpected
6+
stdout_logfile=syslog
7+
stderr_logfile=syslog
8+
dependent_startup=true
9+
dependent_startup_wait_for=swssconfig:exited

0 commit comments

Comments
 (0)