2017-05-08 17:43:31 -05:00
|
|
|
[supervisord]
|
|
|
|
logfile_maxbytes=1MB
|
|
|
|
logfile_backups=2
|
|
|
|
nodaemon=true
|
|
|
|
|
2020-05-15 20:00:47 -05:00
|
|
|
[eventlistener:dependent-startup]
|
2020-11-20 01:41:32 -06:00
|
|
|
command=python3 -m supervisord_dependent_startup
|
2020-05-15 20:00:47 -05:00
|
|
|
autostart=true
|
|
|
|
autorestart=unexpected
|
|
|
|
startretries=0
|
|
|
|
exitcodes=0,3
|
|
|
|
events=PROCESS_STATE
|
[dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 (#7083)
To prevent error [messages](https://dev.azure.com/mssonic/build/_build/results?buildId=2254&view=logs&j=9a13fbcd-e92d-583c-2f89-d81f90cac1fd&t=739db6ba-1b35-5485-5697-de102068d650&l=802) like the following from being logged:
```
Mar 17 02:33:48.523153 vlab-01 INFO swss#supervisord 2021-03-17 02:33:48,518 ERRO pool supervisor-proc-exit-listener event buffer overflowed, discarding event 46
```
This is basically an addendum to https://github.com/Azure/sonic-buildimage/pull/5247, which increased the event buffer size for dependent-startup. While supervisor-proc-exit-listener doesn't subscribe to as many events as dependent-startup, there is still a chance some containers (like swss, as in the example above) have enough processes running to cause an overflow of the default buffer size of 10.
This is especially important for preventing erroneous log_analyzer failures in the sonic-mgmt repo regression tests, which have started occasionally causing PR check builds to fail. Example [here](https://dev.azure.com/mssonic/build/_build/results?buildId=2254&view=logs&j=9a13fbcd-e92d-583c-2f89-d81f90cac1fd&t=739db6ba-1b35-5485-5697-de102068d650&l=802).
I set all supervisor-proc-exit-listener event buffer sizes to 1024, and also updated all dependent-startup event buffer sizes to 1024, as well, to keep things simple, unified, and allow headroom so that we will not need to adjust these values frequently, if at all.
2021-03-27 23:14:24 -05:00
|
|
|
buffer_size=1024
|
2020-05-15 20:00:47 -05:00
|
|
|
|
2019-11-04 19:44:01 -06:00
|
|
|
[eventlistener:supervisor-proc-exit-listener]
|
2020-02-07 14:34:07 -06:00
|
|
|
command=/usr/bin/supervisor-proc-exit-listener --container-name pmon
|
[supervisord] Monitoring the critical processes with supervisord. (#6242)
- Why I did it
Initially, we used Monit to monitor critical processes in each container. If one of critical processes was not running
or crashed due to some reasons, then Monit will write an alerting message into syslog periodically. If we add a new process
in a container, the corresponding Monti configuration file will also need to update. It is a little hard for maintenance.
Currently we employed event listener of Supervisod to do this monitoring. Since processes in each container are managed by
Supervisord, we can only focus on the logic of monitoring.
- How I did it
We borrowed the event listener of Supervisord to monitor critical processes in containers. The event listener will take
following steps if it was notified one of critical processes exited unexpectedly:
The event listener will first check whether the auto-restart mechanism was enabled for this container or not. If auto-restart mechanism was enabled, event listener will kill the Supervisord process, which should cause the container to exit and subsequently get restarted.
If auto-restart mechanism was not enabled for this contianer, the event listener will enter a loop which will first sleep 1 minute and then check whether the process is running. If yes, the event listener exits. If no, an alerting message will be written into syslog.
- How to verify it
First, we need checked whether the auto-restart mechanism of a container was enabled or not by running the command show feature status. If enabled, one critical process should be selected and killed manually, then we need check whether the container will be restarted or not.
Second, we can disable the auto-restart mechanism if it was enabled at step 1 by running the commnad sudo config feature autorestart <container_name> disabled. Then one critical process should be selected and killed. After that, we will see the alerting message which will appear in the syslog every 1 minute.
- Which release branch to backport (provide reason below if selected)
201811
201911
[x ] 202006
2021-01-21 14:57:49 -06:00
|
|
|
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
|
2019-11-04 19:44:01 -06:00
|
|
|
autostart=true
|
|
|
|
autorestart=unexpected
|
[dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 (#7083)
To prevent error [messages](https://dev.azure.com/mssonic/build/_build/results?buildId=2254&view=logs&j=9a13fbcd-e92d-583c-2f89-d81f90cac1fd&t=739db6ba-1b35-5485-5697-de102068d650&l=802) like the following from being logged:
```
Mar 17 02:33:48.523153 vlab-01 INFO swss#supervisord 2021-03-17 02:33:48,518 ERRO pool supervisor-proc-exit-listener event buffer overflowed, discarding event 46
```
This is basically an addendum to https://github.com/Azure/sonic-buildimage/pull/5247, which increased the event buffer size for dependent-startup. While supervisor-proc-exit-listener doesn't subscribe to as many events as dependent-startup, there is still a chance some containers (like swss, as in the example above) have enough processes running to cause an overflow of the default buffer size of 10.
This is especially important for preventing erroneous log_analyzer failures in the sonic-mgmt repo regression tests, which have started occasionally causing PR check builds to fail. Example [here](https://dev.azure.com/mssonic/build/_build/results?buildId=2254&view=logs&j=9a13fbcd-e92d-583c-2f89-d81f90cac1fd&t=739db6ba-1b35-5485-5697-de102068d650&l=802).
I set all supervisor-proc-exit-listener event buffer sizes to 1024, and also updated all dependent-startup event buffer sizes to 1024, as well, to keep things simple, unified, and allow headroom so that we will not need to adjust these values frequently, if at all.
2021-03-27 23:14:24 -05:00
|
|
|
buffer_size=1024
|
2019-11-04 19:44:01 -06:00
|
|
|
|
2020-05-15 20:00:47 -05:00
|
|
|
[program:rsyslogd]
|
|
|
|
command=/usr/sbin/rsyslogd -n -iNONE
|
2017-05-08 17:43:31 -05:00
|
|
|
priority=1
|
2020-05-15 20:00:47 -05:00
|
|
|
autostart=false
|
2017-05-09 19:37:08 -05:00
|
|
|
autorestart=false
|
2017-05-08 17:43:31 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2017-05-08 17:43:31 -05:00
|
|
|
|
2020-12-15 18:28:58 -06:00
|
|
|
{% if not skip_chassisd and IS_MODULAR_CHASSIS == 1 %}
|
|
|
|
[program:chassisd]
|
|
|
|
command=/usr/local/bin/chassisd
|
|
|
|
priority=3
|
|
|
|
autostart=false
|
2021-08-04 11:57:54 -05:00
|
|
|
autorestart=unexpected
|
2020-12-15 18:28:58 -06:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2021-08-04 11:57:54 -05:00
|
|
|
startsecs=10
|
2020-12-15 18:28:58 -06:00
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
|
|
|
{% endif %}
|
|
|
|
|
2021-10-24 11:10:41 -05:00
|
|
|
{% if not skip_chassis_db_init %}
|
2021-05-28 14:01:03 -05:00
|
|
|
[program:chassis_db_init]
|
|
|
|
command=/usr/local/bin/chassis_db_init
|
|
|
|
priority=3
|
|
|
|
autostart=false
|
2022-02-15 02:51:24 -06:00
|
|
|
autorestart=false
|
2021-05-28 14:01:03 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2022-03-03 19:10:15 -06:00
|
|
|
startsecs=0
|
2021-05-28 14:01:03 -05:00
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2021-10-24 11:10:41 -05:00
|
|
|
{% endif %}
|
2021-05-28 14:01:03 -05:00
|
|
|
|
2020-05-15 20:00:47 -05:00
|
|
|
{% if not skip_sensors and HAVE_SENSORS_CONF == 1 %}
|
2017-05-08 17:43:31 -05:00
|
|
|
[program:lm-sensors]
|
|
|
|
command=/usr/bin/lm-sensors.sh
|
|
|
|
priority=3
|
|
|
|
autostart=false
|
2017-05-09 19:37:08 -05:00
|
|
|
autorestart=false
|
2017-05-08 17:43:31 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2017-08-15 12:38:22 -05:00
|
|
|
startsecs=0
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2020-04-21 10:00:48 -05:00
|
|
|
{% endif %}
|
2017-05-08 17:43:31 -05:00
|
|
|
|
2020-05-15 20:00:47 -05:00
|
|
|
{% if not skip_fancontrol and HAVE_FANCONTROL_CONF == 1 %}
|
2017-06-23 17:23:00 -05:00
|
|
|
[program:fancontrol]
|
|
|
|
command=/usr/sbin/fancontrol
|
|
|
|
priority=4
|
|
|
|
autostart=false
|
2020-03-19 19:24:22 -05:00
|
|
|
autorestart=unexpected
|
2017-06-23 17:23:00 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2020-03-19 19:24:22 -05:00
|
|
|
startsecs=10
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2020-04-21 10:00:48 -05:00
|
|
|
{% endif %}
|
2017-06-23 17:23:00 -05:00
|
|
|
|
2019-03-22 04:49:35 -05:00
|
|
|
{% if not skip_ledd %}
|
2017-06-11 00:05:11 -05:00
|
|
|
[program:ledd]
|
2021-01-22 09:12:01 -06:00
|
|
|
command={% if API_VERSION == 3 and 'ledd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/ledd
|
2017-06-23 17:23:00 -05:00
|
|
|
priority=5
|
2017-06-11 00:05:11 -05:00
|
|
|
autostart=false
|
2021-08-04 11:57:54 -05:00
|
|
|
autorestart=unexpected
|
2017-06-11 00:05:11 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2021-08-04 11:57:54 -05:00
|
|
|
startsecs=10
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2019-03-22 04:49:35 -05:00
|
|
|
{% endif %}
|
2018-08-03 18:33:56 -05:00
|
|
|
|
2019-03-22 04:49:35 -05:00
|
|
|
{% if not skip_xcvrd %}
|
2018-08-03 18:33:56 -05:00
|
|
|
[program:xcvrd]
|
2020-12-02 13:28:18 -06:00
|
|
|
{% if delay_xcvrd %}
|
2022-06-22 12:14:06 -05:00
|
|
|
command={% if skip_xcvrd_cmis_mgr %} bash -c "sleep 30 && python3 /usr/local/bin/xcvrd --skip_cmis_mgr" {% else %} bash -c "sleep 30 && python3 /usr/local/bin/xcvrd" {% endif %}
|
|
|
|
|
2020-12-02 13:28:18 -06:00
|
|
|
{% else %}
|
2022-06-22 12:14:06 -05:00
|
|
|
command={% if skip_xcvrd_cmis_mgr %} python3 /usr/local/bin/xcvrd --skip_cmis_mgr {% else %} python3 /usr/local/bin/xcvrd {% endif %}
|
|
|
|
|
2020-12-02 13:28:18 -06:00
|
|
|
{% endif %}
|
2018-08-03 18:33:56 -05:00
|
|
|
priority=6
|
|
|
|
autostart=false
|
2021-08-04 11:57:54 -05:00
|
|
|
autorestart=unexpected
|
2018-08-03 18:33:56 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2021-08-04 11:57:54 -05:00
|
|
|
startsecs=10
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2019-03-22 04:49:35 -05:00
|
|
|
{% endif %}
|
2019-01-15 23:24:47 -06:00
|
|
|
|
2023-09-13 16:10:56 -05:00
|
|
|
{% if DEVICE_METADATA and 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}
|
2022-01-25 13:10:25 -06:00
|
|
|
{% if not skip_ycabled %}
|
|
|
|
[program:ycabled]
|
|
|
|
{% if delay_ycabled %}
|
|
|
|
command=bash -c "sleep 30 && nice -n -20 python3 /usr/local/bin/ycabled"
|
|
|
|
{% else %}
|
|
|
|
command=nice -n -20 python3 /usr/local/bin/ycabled
|
|
|
|
{% endif %}
|
|
|
|
priority=7
|
|
|
|
autostart=false
|
|
|
|
autorestart=unexpected
|
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
|
|
|
startsecs=10
|
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
2019-03-22 04:49:35 -05:00
|
|
|
{% if not skip_psud %}
|
2019-01-15 23:24:47 -06:00
|
|
|
[program:psud]
|
2020-12-28 12:19:24 -06:00
|
|
|
command={% if API_VERSION == 3 and 'psud' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/psud
|
2022-01-25 13:10:25 -06:00
|
|
|
priority=8
|
2019-01-15 23:24:47 -06:00
|
|
|
autostart=false
|
2021-08-04 11:57:54 -05:00
|
|
|
autorestart=unexpected
|
2019-01-15 23:24:47 -06:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2021-08-04 11:57:54 -05:00
|
|
|
startsecs=10
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2019-03-22 04:49:35 -05:00
|
|
|
{% endif %}
|
2019-06-18 13:02:24 -05:00
|
|
|
|
|
|
|
{% if not skip_syseepromd %}
|
|
|
|
[program:syseepromd]
|
2020-12-28 12:19:24 -06:00
|
|
|
command={% if API_VERSION == 3 and 'syseepromd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/syseepromd
|
2022-01-25 13:10:25 -06:00
|
|
|
priority=9
|
2019-06-18 13:02:24 -05:00
|
|
|
autostart=false
|
2020-04-30 17:51:34 -05:00
|
|
|
autorestart=unexpected
|
2019-06-18 13:02:24 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2020-04-30 17:51:34 -05:00
|
|
|
startsecs=10
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2019-06-18 13:02:24 -05:00
|
|
|
{% endif %}
|
2020-03-09 12:41:10 -05:00
|
|
|
|
|
|
|
{% if not skip_thermalctld %}
|
|
|
|
[program:thermalctld]
|
2020-12-28 12:19:24 -06:00
|
|
|
command={% if API_VERSION == 3 and 'thermalctld' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/thermalctld
|
2022-01-25 13:10:25 -06:00
|
|
|
priority=10
|
2020-03-09 12:41:10 -05:00
|
|
|
autostart=false
|
2020-04-30 17:51:34 -05:00
|
|
|
autorestart=unexpected
|
2020-03-09 12:41:10 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2020-04-30 17:51:34 -05:00
|
|
|
startsecs=10
|
2020-10-30 14:01:17 -05:00
|
|
|
startretries=50
|
2020-05-15 20:00:47 -05:00
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2020-03-09 12:41:10 -05:00
|
|
|
{% endif %}
|
2020-07-29 13:27:49 -05:00
|
|
|
|
|
|
|
{% if not skip_pcied %}
|
|
|
|
[program:pcied]
|
2022-04-09 15:16:50 -05:00
|
|
|
command=/usr/local/bin/pcied
|
2022-01-25 13:10:25 -06:00
|
|
|
priority=11
|
2020-07-29 13:27:49 -05:00
|
|
|
autostart=false
|
|
|
|
autorestart=unexpected
|
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
|
|
|
startsecs=10
|
|
|
|
dependent_startup=true
|
2020-12-28 12:19:24 -06:00
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2020-07-29 13:27:49 -05:00
|
|
|
{% endif %}
|