[Services] Restart LLDP service upon unexpected critical process exit. (#3713)
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
This commit is contained in:
parent
05e659901f
commit
a117b25446
@ -40,5 +40,7 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
COPY ["lldpd.conf.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["lldpd", "/etc/default/"]
|
||||
COPY ["lldpmgrd", "/usr/bin/"]
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
COPY ["critical_processes", "/etc/supervisor"]
|
||||
|
||||
ENTRYPOINT ["/usr/bin/supervisord"]
|
||||
|
3
dockers/docker-lldp-sv2/critical_processes
Normal file
3
dockers/docker-lldp-sv2/critical_processes
Normal file
@ -0,0 +1,3 @@
|
||||
lldpd
|
||||
lldp-syncd
|
||||
lldpmgrd
|
@ -3,6 +3,12 @@ logfile_maxbytes=1MB
|
||||
logfile_backups=2
|
||||
nodaemon=true
|
||||
|
||||
[eventlistener:supervisor-proc-exit-listener]
|
||||
command=/usr/bin/supervisor-proc-exit-listener
|
||||
events=PROCESS_STATE_EXITED
|
||||
autostart=true
|
||||
autorestart=unexpected
|
||||
|
||||
[program:start.sh]
|
||||
command=/usr/bin/start.sh
|
||||
priority=1
|
||||
|
@ -3,12 +3,16 @@ Description=LLDP container
|
||||
Requires=updategraph.service
|
||||
After=updategraph.service swss.service syncd.service
|
||||
Before=ntp-config.service
|
||||
StartLimitIntervalSec=1200
|
||||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User={{ sonicadmin_user }}
|
||||
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
|
||||
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
|
||||
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -30,3 +30,4 @@ $(DOCKER_LLDP_SV2)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||
|
||||
$(DOCKER_LLDP_SV2)_BASE_IMAGE_FILES += lldpctl:/usr/bin/lldpctl
|
||||
$(DOCKER_LLDP_SV2)_BASE_IMAGE_FILES += lldpcli:/usr/bin/lldpcli
|
||||
$(DOCKER_LLDP_SV2)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
|
||||
|
Reference in New Issue
Block a user