File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ RUN apt-get update \
3838COPY ["start.sh", "/usr/bin/"]
3939COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
4040COPY ["restore_nat_entries.py", "/usr/bin/"]
41+ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
42+ COPY ["critical_processes", "/etc/supervisor"]
4143
4244RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
4345RUN rm -rf /debs
Original file line number Diff line number Diff line change 1+ natmgrd
2+ natsyncd
Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ logfile_maxbytes=1MB
33logfile_backups=2
44nodaemon=true
55
6+ [eventlistener:supervisor-proc-exit-listener]
7+ command=/usr/bin/supervisor-proc-exit-listener --container-name nat
8+ events=PROCESS_STATE_EXITED
9+ autostart=true
10+ autorestart=unexpected
11+
612[program:start.sh]
713command=/usr/bin/start.sh
814priority=1
@@ -15,7 +21,7 @@ stderr_logfile=syslog
1521command=/usr/sbin/rsyslogd -n
1622priority=2
1723autostart=false
18- autorestart=false
24+ autorestart=unexpected
1925stdout_logfile=syslog
2026stderr_logfile=syslog
2127
Original file line number Diff line number Diff line change @@ -3,12 +3,16 @@ Description=NAT container
33Requires=updategraph.service swss.service
44After=updategraph.service swss.service syncd.service
55Before=ntp-config.service
6+ StartLimitIntervalSec=1200
7+ StartLimitBurst=3
68
79[Service]
810User={{ sonicadmin_user }}
911ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
1012ExecStart=/usr/bin/{{docker_container_name}}.sh wait
1113ExecStop=/usr/bin/{{docker_container_name}}.sh stop
14+ Restart=always
15+ RestartSec=30
1216
1317[Install]
1418WantedBy=multi-user.target swss.service
Original file line number Diff line number Diff line change @@ -30,5 +30,6 @@ $(DOCKER_NAT)_RUN_OPT += --privileged -t
3030$(DOCKER_NAT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
3131$(DOCKER_NAT)_RUN_OPT += -v /host/warmboot:/var/warmboot
3232
33- $(DOCKER_NAT)_BASE_IMAGE_FILES += natctl:/usr/bin/natctl
33+ $(DOCKER_NAT)_FILES += $( SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT )
3434
35+ $(DOCKER_NAT)_BASE_IMAGE_FILES += natctl:/usr/bin/natctl
You can’t perform that action at this time.
0 commit comments