[Services] Restart Sflow service upon unexpected critical process exit. (#3751)
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
This commit is contained in:
parent
57728c5c8b
commit
67fc68513e
@ -29,5 +29,7 @@ RUN sed -ri '/^DAEMON_ARGS=""/c DAEMON_ARGS="-c /var/log/hsflowd.crash"' /etc/in
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
COPY ["critical_processes", "/etc/supervisor"]
|
||||
|
||||
ENTRYPOINT ["/usr/bin/supervisord"]
|
||||
|
1
dockers/docker-sflow/critical_processes
Normal file
1
dockers/docker-sflow/critical_processes
Normal file
@ -0,0 +1 @@
|
||||
sflowmgrd
|
@ -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=sFlow container
|
||||
Requires=swss.service
|
||||
After=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
|
||||
|
@ -32,4 +32,4 @@ $(DOCKER_SFLOW)_RUN_OPT += -v /host/warmboot:/var/warmboot
|
||||
|
||||
$(DOCKER_SFLOW)_BASE_IMAGE_FILES += psample:/usr/bin/psample
|
||||
$(DOCKER_SFLOW)_BASE_IMAGE_FILES += sflowtool:/usr/bin/sflowtool
|
||||
|
||||
$(DOCKER_SFLOW)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
|
||||
|
Loading…
Reference in New Issue
Block a user