[Services] Restart Router-advertiser service upon unexpected critical process exit (#3681)
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
This commit is contained in:
parent
8db6df508b
commit
cff30c59d0
@ -27,5 +27,7 @@ RUN apt-get clean -y && \
|
|||||||
COPY ["start.sh", "/usr/bin/"]
|
COPY ["start.sh", "/usr/bin/"]
|
||||||
COPY ["docker-router-advertiser.supervisord.conf", "/etc/supervisor/conf.d/"]
|
COPY ["docker-router-advertiser.supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||||
COPY ["radvd.conf.j2", "wait_for_intf.sh.j2", "/usr/share/sonic/templates/"]
|
COPY ["radvd.conf.j2", "wait_for_intf.sh.j2", "/usr/share/sonic/templates/"]
|
||||||
|
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||||
|
COPY ["critical_processes", "/etc/supervisor"]
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/supervisord"]
|
ENTRYPOINT ["/usr/bin/supervisord"]
|
||||||
|
1
dockers/docker-router-advertiser/critical_processes
Normal file
1
dockers/docker-router-advertiser/critical_processes
Normal file
@ -0,0 +1 @@
|
|||||||
|
radvd
|
@ -3,6 +3,12 @@ logfile_maxbytes=1MB
|
|||||||
logfile_backups=2
|
logfile_backups=2
|
||||||
nodaemon=true
|
nodaemon=true
|
||||||
|
|
||||||
|
[eventlistener:supervisor-proc-exit-script]
|
||||||
|
command=/usr/bin/supervisor-proc-exit-listener
|
||||||
|
events=PROCESS_STATE_EXITED
|
||||||
|
autostart=true
|
||||||
|
autorestart=unexpected
|
||||||
|
|
||||||
[program:start.sh]
|
[program:start.sh]
|
||||||
command=/usr/bin/start.sh
|
command=/usr/bin/start.sh
|
||||||
priority=1
|
priority=1
|
||||||
|
@ -3,12 +3,16 @@ Description=Router advertiser container
|
|||||||
Requires=updategraph.service
|
Requires=updategraph.service
|
||||||
After=updategraph.service swss.service
|
After=updategraph.service swss.service
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
StartLimitIntervalSec=1200
|
||||||
|
StartLimitBurst=3
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User={{ sonicadmin_user }}
|
User={{ sonicadmin_user }}
|
||||||
ExecStartPre=/usr/bin/{{ docker_container_name }}.sh start
|
ExecStartPre=/usr/bin/{{ docker_container_name }}.sh start
|
||||||
ExecStart=/usr/bin/{{ docker_container_name }}.sh wait
|
ExecStart=/usr/bin/{{ docker_container_name }}.sh wait
|
||||||
ExecStop=/usr/bin/{{ docker_container_name }}.sh stop
|
ExecStop=/usr/bin/{{ docker_container_name }}.sh stop
|
||||||
|
Restart=always
|
||||||
|
RestartSec=30
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -25,3 +25,4 @@ SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_ROUTER_ADVERTISER_DBG)
|
|||||||
$(DOCKER_ROUTER_ADVERTISER)_CONTAINER_NAME = radv
|
$(DOCKER_ROUTER_ADVERTISER)_CONTAINER_NAME = radv
|
||||||
$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --net=host --privileged -t
|
$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --net=host --privileged -t
|
||||||
$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||||
|
$(DOCKER_ROUTER_ADVERTISER)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
|
||||||
|
Loading…
Reference in New Issue
Block a user