sonic-buildimage/platform/broadcom/sonic-platform-modules-dell
Hua Liu 51b60613f7 [S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. (#14402)
[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.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
```

#### 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.
2023-04-21 02:32:56 +08:00
..
common DellEMC: S6100, Z9332f - Include ONIE version in 'show platform firmware status' (#10493) 2022-05-12 09:24:06 -07:00
debian [S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. (#14402) 2023-04-21 02:32:56 +08:00
n3248pxe DellEMC: N3248TE/N3248PXE Watchdog Support (#9398) 2022-04-01 07:33:08 -07:00
n3248te DellEMC: N3248TE platform API2.0 changes (#10400) 2022-04-01 07:34:31 -07:00
s5212f [DellEMC] S5212F and S5224F 2.0 API changes (#10315) 2022-06-16 16:50:11 -07:00
s5224f [DellEMC] S5212F and S5224F 2.0 API changes (#10315) 2022-06-16 16:50:11 -07:00
s5232f [DellEMC] Fix S5248f platform issues (#11076) 2022-06-09 09:38:13 -07:00
s5248f [DellEMC] Fix S5248f platform issues (#11076) 2022-06-09 09:38:13 -07:00
s5296f DellEMC: S5296F Platform API 2.0 changes (#11162) 2022-08-25 17:07:23 -07:00
s6000 DellEMC: S6100, S6000 - Platform API implementation (#9586) 2022-01-02 22:38:35 -08:00
s6100 [S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. (#14402) 2023-04-21 02:32:56 +08:00
z9100 DellEMC SFP Refactor (#9142) 2021-11-17 21:40:46 +05:30
z9264f DellEMC: Fix Z9332f thermalctld warning logs (#9943) 2022-02-10 09:16:58 -08:00
z9332f DellEMC: Z9332f - Graceful platform reboot (#10240) 2022-08-30 11:23:52 -07:00
z9432f DellEMC: Initial commit for Z9432F platform (#10640) 2022-06-15 09:39:41 -07:00
.gitignore Reorganize .gitignore files (#4707) 2020-06-09 21:04:55 -07:00
LICENSE [platform]: move dell platform modules into buildimage repo 2018-08-13 10:39:07 +00:00
README.md [platform]: move dell platform modules into buildimage repo 2018-08-13 10:39:07 +00:00

platform drivers for Dell Z9100 for the SONiC project