2016-10-25 20:52:13 -05:00
|
|
|
[supervisord]
|
2017-05-08 17:43:31 -05:00
|
|
|
logfile_maxbytes=1MB
|
|
|
|
logfile_backups=2
|
2016-10-25 20:52:13 -05:00
|
|
|
nodaemon=true
|
|
|
|
|
2020-05-14 19:43:46 -05:00
|
|
|
[eventlistener:dependent-startup]
|
2020-11-20 01:41:32 -06:00
|
|
|
command=python3 -m supervisord_dependent_startup
|
2020-05-14 19:43:46 -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-14 19:43:46 -05:00
|
|
|
|
2019-11-06 13:02:57 -06:00
|
|
|
[eventlistener:supervisor-proc-exit-listener]
|
2020-02-07 14:34:07 -06:00
|
|
|
command=/usr/bin/supervisor-proc-exit-listener --container-name lldp
|
[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-06 13:02:57 -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-06 13:02:57 -06:00
|
|
|
|
2020-05-14 19:43:46 -05:00
|
|
|
[program:rsyslogd]
|
|
|
|
command=/usr/sbin/rsyslogd -n -iNONE
|
2017-05-08 17:43:31 -05:00
|
|
|
priority=1
|
2020-05-14 19:43:46 -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-14 19:43:46 -05:00
|
|
|
dependent_startup=true
|
2017-05-08 17:43:31 -05:00
|
|
|
|
2020-05-14 19:43:46 -05:00
|
|
|
[program:start]
|
|
|
|
command=/usr/bin/start.sh
|
2017-05-08 17:43:31 -05:00
|
|
|
priority=2
|
|
|
|
autostart=false
|
2017-05-09 19:37:08 -05:00
|
|
|
autorestart=false
|
2020-05-14 19:43:46 -05:00
|
|
|
startsecs=0
|
2017-05-08 17:43:31 -05:00
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
2020-05-14 19:43:46 -05:00
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=rsyslogd:running
|
2017-05-08 17:43:31 -05:00
|
|
|
|
2016-10-25 20:52:13 -05:00
|
|
|
[program:lldpd]
|
|
|
|
# https://github.com/vincentbernat/lldpd/commit/9856f2792c301116cc4a3fcfba91b9672ee5db1f
|
|
|
|
# - `-d` means to stay in foreground, log to syslog
|
|
|
|
# - `-dd` means to stay in foreground, log warnings to console
|
|
|
|
# - `-ddd` means to stay in foreground, log warnings and info to console
|
|
|
|
# - `-dddd` means to stay in foreground, log all to console
|
2020-05-11 13:05:44 -05:00
|
|
|
{% if DEVICE_METADATA['localhost']['sub_role'] is defined and DEVICE_METADATA['localhost']['sub_role']|length %}
|
|
|
|
command=/usr/sbin/lldpd -d -I Ethernet* -C Ethernet*
|
|
|
|
{% else %}
|
2018-11-28 00:02:06 -06:00
|
|
|
command=/usr/sbin/lldpd -d -I Ethernet*,eth0 -C eth0
|
2020-05-11 13:05:44 -05:00
|
|
|
{% endif %}
|
2018-03-02 18:46:22 -06:00
|
|
|
priority=3
|
2017-05-08 17:43:31 -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-14 19:43:46 -05:00
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=start:exited
|
|
|
|
|
|
|
|
[program:waitfor_lldp_ready]
|
|
|
|
command=/usr/bin/waitfor_lldp_ready.sh
|
|
|
|
priority=3
|
|
|
|
autostart=false
|
|
|
|
autorestart=false
|
|
|
|
startsecs=0
|
|
|
|
stdout_logfile=syslog
|
|
|
|
stderr_logfile=syslog
|
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=lldpd:running
|
2016-10-25 20:52:13 -05:00
|
|
|
|
2018-03-02 18:46:22 -06:00
|
|
|
[program:lldp-syncd]
|
2020-11-30 12:44:40 -06:00
|
|
|
command=/usr/bin/env python3 -m lldp_syncd
|
2018-03-02 18:46:22 -06:00
|
|
|
priority=4
|
2017-05-08 17:43:31 -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-14 19:43:46 -05:00
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=waitfor_lldp_ready:exited
|
2016-10-31 14:25:09 -05:00
|
|
|
|
2018-03-02 18:46:22 -06:00
|
|
|
[program:lldpmgrd]
|
|
|
|
command=/usr/bin/lldpmgrd
|
|
|
|
priority=5
|
2017-05-08 17:43:31 -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-14 19:43:46 -05:00
|
|
|
dependent_startup=true
|
|
|
|
dependent_startup_wait_for=lldp-syncd:running
|