5206fcd097
[S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. #### Why I did it On S6100, the serial-getty service some time can't auto-restart by systemd. So there is a monit unit to check serial-getty service status and restart it. However, this monit will report false alert, because in most case when serial-getty not running, systemd can restart it successfully. To avoid the false alert, improve the monitor to wait and re-check. Steps to reproduce this issue: 1. User login to device via console, and keep the connection. 2. User login to device via SSH, check the serial-getty@ttyS1.service service, it's running. 3. Run 'monit reload' from SSH connection. 4. Check syslog 1 minutes later, there will be false alert: ' 'serial-getty' process is not running' #### How I did it Add check-getty.sh script to recheck again later when getty service not running. And update monit unit to check serial-getty service status with this script to avoid false alert. #### How to verify it Pass all UT. Manually check fixed code work correctly: ``` admin@***:~$ sudo systemctl stop serial-getty@ttyS1.service admin@***:~$ sudo /usr/local/bin/check-getty.sh admin@***:~$ echo $? 1 admin@***:~$ sudo systemctl status serial-getty@ttyS1.service ● serial-getty@ttyS1.service - Serial Getty on ttyS1 Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled-runtime; vendor preset: enabled) Active: inactive (dead) since Tue 2023-03-28 07:15:21 UTC; 1min 13s ago admin@***:~$ sudo /usr/local/bin/check-getty.sh admin@***:~$ echo $? 0 admin@***:~$ sudo systemctl status serial-getty@ttyS1.service ● serial-getty@ttyS1.service - Serial Getty on ttyS1 Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled-runtime; vendor preset: enabled) ``` syslog: ``` Mar 28 07:10:37.597458 *** INFO systemd[1]: serial-getty@ttyS1.service: Succeeded. Mar 28 07:12:43.010550 *** ERR monit[593]: 'serial-getty' status failed (1) -- no output Mar 28 07:12:43.010744 *** INFO monit[593]: 'serial-getty' trying to restart Mar 28 07:12:43.010846 *** INFO monit[593]: 'serial-getty' stop: '/bin/systemctl stop serial-getty@ttyS1.service' Mar 28 07:12:43.132172 *** INFO monit[593]: 'serial-getty' start: '/bin/systemctl start serial-getty@ttyS1.service' Mar 28 07:13:43.286276 *** INFO monit[593]: 'serial-getty' status succeeded (0) -- no output ``` #### Description for the changelog [S6100] Improve S6100 serial-getty monitor. #### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. |
||
---|---|---|
.. | ||
docker-saiserver-brcm | ||
docker-syncd-brcm | ||
docker-syncd-brcm-dnx | ||
docker-syncd-brcm-dnx-rpc | ||
docker-syncd-brcm-rpc | ||
saibcm-modules | ||
saibcm-modules-dnx@af0ed840c7 | ||
sonic-platform-modules-accton | ||
sonic-platform-modules-alphanetworks | ||
sonic-platform-modules-arista@818cebb5c9 | ||
sonic-platform-modules-brcm-xlr-gts | ||
sonic-platform-modules-cel | ||
sonic-platform-modules-dell | ||
sonic-platform-modules-delta | ||
sonic-platform-modules-ingrasys | ||
sonic-platform-modules-inventec | ||
sonic-platform-modules-juniper | ||
sonic-platform-modules-mitac | ||
sonic-platform-modules-nokia@b027ce0fbc | ||
sonic-platform-modules-quanta | ||
sonic-platform-modules-ragile | ||
sonic-platform-modules-ruijie | ||
docker-pde.dep | ||
docker-pde.mk | ||
docker-saiserver-brcm.dep | ||
docker-saiserver-brcm.mk | ||
docker-syncd-brcm-dnx-rpc.dep | ||
docker-syncd-brcm-dnx-rpc.mk | ||
docker-syncd-brcm-dnx.dep | ||
docker-syncd-brcm-dnx.mk | ||
docker-syncd-brcm-rpc.dep | ||
docker-syncd-brcm-rpc.mk | ||
docker-syncd-brcm.dep | ||
docker-syncd-brcm.mk | ||
libsaithrift-dev.dep | ||
libsaithrift-dev.mk | ||
one-aboot.dep | ||
one-aboot.mk | ||
one-image.dep | ||
one-image.mk | ||
platform-modules-accton.dep | ||
platform-modules-accton.mk | ||
platform-modules-alphanetworks.dep | ||
platform-modules-alphanetworks.mk | ||
platform-modules-arista.dep | ||
platform-modules-arista.mk | ||
platform-modules-brcm-xlr-gts.dep | ||
platform-modules-brcm-xlr-gts.mk | ||
platform-modules-cel.dep | ||
platform-modules-cel.mk | ||
platform-modules-dell.dep | ||
platform-modules-dell.mk | ||
platform-modules-delta.dep | ||
platform-modules-delta.mk | ||
platform-modules-ingrasys.dep | ||
platform-modules-ingrasys.mk | ||
platform-modules-inventec.dep | ||
platform-modules-inventec.mk | ||
platform-modules-juniper.dep | ||
platform-modules-juniper.mk | ||
platform-modules-mitac.dep | ||
platform-modules-mitac.mk | ||
platform-modules-nokia.dep | ||
platform-modules-nokia.mk | ||
platform-modules-quanta.dep | ||
platform-modules-quanta.mk | ||
platform-modules-ragile.dep | ||
platform-modules-ragile.mk | ||
platform-modules-ruijie.dep | ||
platform-modules-ruijie.mk | ||
platform-modules-s6000.dep | ||
platform.conf | ||
raw-image.dep | ||
raw-image.mk | ||
rules.dep | ||
rules.mk | ||
sai-modules.dep | ||
sai-modules.mk | ||
sai.dep | ||
sai.mk | ||
sonic-pde-tests.dep | ||
sonic-pde-tests.mk |