[Services] Restart Platform-monitor service upon unexpected critical process exit. (#3689)
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
This commit is contained in:
parent
d85777bb11
commit
4fa3a1e27e
@ -57,5 +57,7 @@ RUN apt-get purge -y \
|
|||||||
COPY ["docker_init.sh", "lm-sensors.sh", "/usr/bin/"]
|
COPY ["docker_init.sh", "lm-sensors.sh", "/usr/bin/"]
|
||||||
COPY ["docker-pmon.supervisord.conf.j2", "start.sh.j2", "/usr/share/sonic/templates/"]
|
COPY ["docker-pmon.supervisord.conf.j2", "start.sh.j2", "/usr/share/sonic/templates/"]
|
||||||
COPY ["ssd_tools/*", "/usr/bin/"]
|
COPY ["ssd_tools/*", "/usr/bin/"]
|
||||||
|
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||||
|
COPY ["critical_processes", "/etc/supervisor"]
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/docker_init.sh"]
|
ENTRYPOINT ["/usr/bin/docker_init.sh"]
|
||||||
|
5
dockers/docker-platform-monitor/critical_processes
Normal file
5
dockers/docker-platform-monitor/critical_processes
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
fancontrol
|
||||||
|
ledd
|
||||||
|
xcvrd
|
||||||
|
psud
|
||||||
|
syseepromd
|
@ -3,6 +3,12 @@ logfile_maxbytes=1MB
|
|||||||
logfile_backups=2
|
logfile_backups=2
|
||||||
nodaemon=true
|
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]
|
[program:start.sh]
|
||||||
command=/usr/bin/start.sh
|
command=/usr/bin/start.sh
|
||||||
priority=1
|
priority=1
|
||||||
|
@ -6,12 +6,16 @@ After=updategraph.service
|
|||||||
After=syncd.service
|
After=syncd.service
|
||||||
{% endif %}
|
{% endif %}
|
||||||
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
|
||||||
|
@ -44,3 +44,4 @@ $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/bin/sensors
|
|||||||
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/smartctl
|
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/smartctl
|
||||||
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/iSmart
|
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/iSmart
|
||||||
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/SmartCmd
|
$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/SmartCmd
|
||||||
|
$(DOCKER_PLATFORM_MONITOR)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
|
||||||
|
Loading…
Reference in New Issue
Block a user