sonic-buildimage/platform/broadcom
Hua Liu 1f3da955b9
[S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. (#14402) (#14755)
[S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. 

This is cherry-pick PR for: https://github.com/sonic-net/sonic-buildimage/pull/14402

#### 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'

##### Work item tracking
- Microsoft ADO :17424426

#### 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.serviceserial-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.serviceserial-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
```

#### Tested branch (Please provide the tested image version)

- [x] 20201231.77

#### Description for the changelog
[S6100] Improve S6100 serial-getty monitor.
2023-04-20 23:10:01 -07:00
..
docker-saiserver-brcm [Cherry-pick][SAIServer]Upgrade SAI server init script (#13175) (#13226) 2023-01-03 13:22:32 +08:00
docker-syncd-brcm [202012] start_led.sh re-enable LED INIT for warmreboot (#7901) 2021-06-17 08:21:14 -07:00
docker-syncd-brcm-rpc [syncd-rpc] Install Libboost Atomic 1.71, Libqtcore And Libqtnetwork (#6689) 2021-02-16 15:29:21 -08:00
saibcm-modules Port PR:https://github.com/Azure/sonic-buildimage/pull/8002 (#8851) 2021-10-19 13:47:42 -07:00
sonic-platform-modules-accton [AS5835-54X] Support system-health and remove extra code (#8137) 2021-07-24 18:35:06 -07:00
sonic-platform-modules-alphanetworks [sonic-linux-kernel]: security update to kernel 4.19.152 (#6490) 2021-02-16 15:28:34 -08:00
sonic-platform-modules-arista@a682da369c [202012][Arista] Backport logrotate configuration (#9518) 2022-01-21 23:17:14 +05:30
sonic-platform-modules-brcm-xlr-gts [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:22:51 -08:00
sonic-platform-modules-cel [Seastone] fix dx010 qsfp eeprom data write issue (#13930) 2023-03-02 20:06:09 +00:00
sonic-platform-modules-dell [S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. (#14402) (#14755) 2023-04-20 23:10:01 -07:00
sonic-platform-modules-delta [sonic-linux-kernel]: security update to kernel 4.19.152 (#6490) 2021-02-16 15:28:34 -08:00
sonic-platform-modules-ingrasys [platform-modules]: fix compile issues for platform driver under 4.19 2020-04-17 04:51:51 +00:00
sonic-platform-modules-inventec [sonic-linux-kernel]: security update to kernel 4.19.152 (#6490) 2021-02-16 15:28:34 -08:00
sonic-platform-modules-juniper [Juniper] Platform bug fixes / improvements (#5541) 2020-11-10 22:13:23 -08:00
sonic-platform-modules-mitac [sonic-linux-kernel]: security update to kernel 4.19.152 (#6490) 2021-02-16 15:28:34 -08:00
sonic-platform-modules-quanta [platform][Quanta] Add debian install files for sonic_platform-1.0-py3-none-any.whl (#7947) 2021-06-28 09:33:19 +00:00
docker-saiserver-brcm.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
docker-saiserver-brcm.mk [Cherry-pick][SAIServer]Upgrade SAI server init script (#13175) (#13226) 2023-01-03 13:22:32 +08:00
docker-syncd-brcm-rpc.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
docker-syncd-brcm-rpc.mk Upgrade syncd to buster. (#6106) 2020-12-17 12:46:45 -08:00
docker-syncd-brcm.dep [build]: Fix syncd dpkg cache dependency issue (#6680) 2021-02-05 15:47:28 -08:00
docker-syncd-brcm.mk [202012][Monit] Deprecate the feature of monitoring the critical processes by Monit (#7823) 2021-06-09 09:04:22 -07:00
libsaithrift-dev.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
libsaithrift-dev.mk [202012][Submodule][SAI-Redis]Advance SAI Redis head pointer (#13157) 2022-12-27 08:10:42 +08:00
one-aboot.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
one-aboot.mk [arista] update platform driver submodules (#4512) 2020-04-30 12:06:19 -07:00
one-image.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
one-image.mk [Quanta] Add and update platform and device files (#6971) 2021-06-28 09:33:12 +00:00
one-pde-image.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-accton.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-accton.mk [Platform] Accton add to support as9726-32d platform. (#7479) 2021-05-24 22:09:24 +00:00
platform-modules-alphanetworks.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-alphanetworks.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-arista.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-arista.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-brcm-xlr-gts.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-brcm-xlr-gts.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-cel.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-cel.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-dell.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-dell.mk [devices]: DellEMC new platform support for DellEMC s5296f- 96x25G (#3960) 2020-10-21 11:10:50 -07:00
platform-modules-delta.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-delta.mk [platform/delta]: Add a new supported platform, Delta-agc032 (#4602) 2020-05-27 09:33:02 -07:00
platform-modules-ingrasys.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-ingrasys.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-inventec.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-inventec.mk [Inventec] Add support for D6332 platform (#5304) 2020-10-20 11:37:16 -07:00
platform-modules-juniper.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-juniper.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-mitac.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-mitac.mk [build]: add buster docker as the last step of the build proces 2020-04-16 10:26:18 +00:00
platform-modules-quanta.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-quanta.mk [Quanta] Add and update platform and device files (#6971) 2021-06-28 09:33:12 +00:00
platform-modules-s6000.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform.conf one image implementation (#215) 2017-01-29 11:33:33 -08:00
raw-image.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
raw-image.mk [build]: Move Systemd service start to systemd generator (#3172) 2019-07-29 15:52:15 -07:00
rules.dep [docker-ptf]: build docker ptf 2021-01-28 09:23:12 -08:00
rules.mk [docker-ptf]: build docker ptf 2021-01-28 09:23:12 -08:00
sai-modules.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
sai-modules.mk [BCMSAI] Update BCMSAI debian to 4.3.0.10 with 6.5.21 SDK, and opennsl module to 6.5.21 (#6526) 2021-02-05 16:08:04 -08:00
sai.dep Fix docker images rebuilt issue when building each host image (#5925) 2020-11-24 21:45:06 +08:00
sai.mk [202012] Update SAI version to 4.3.7.1-7 (#13431) 2023-01-19 11:30:40 -08:00