sonic-buildimage/platform/broadcom/sonic-platform-modules-dell/debian
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
..
changelog [platform]: move dell platform modules into buildimage repo 2018-08-13 10:39:07 +00:00
compat [platform]: move dell platform modules into buildimage repo 2018-08-13 10:39:07 +00:00
control Update Linux kernel from 5.10.103 to 5.10.140 (#12660) 2022-11-14 16:33:34 -08:00
platform-modules-n3248pxe.init DellEMC: N3248PXE Initial platform commit (#8562) 2021-09-25 15:35:16 -07:00
platform-modules-n3248pxe.install DellEMC: N3248PXE Initial platform commit (#8562) 2021-09-25 15:35:16 -07:00
platform-modules-n3248pxe.postinst DellEMC: N3248PXE Initial platform commit (#8562) 2021-09-25 15:35:16 -07:00
platform-modules-n3248te.init DellEMC: N3248TE Initial platform commit (#8809) 2021-09-23 20:47:32 -07:00
platform-modules-n3248te.install DellEMC: N3248TE Initial platform commit (#8809) 2021-09-23 20:47:32 -07:00
platform-modules-n3248te.postinst DellEMC: N3248TE Initial platform commit (#8809) 2021-09-23 20:47:32 -07:00
platform-modules-s5212f.init Added Support for Dell EMC S5212f in SONiC (#8678) 2021-10-26 12:52:03 -07:00
platform-modules-s5212f.install Added Support for Dell EMC S5212f in SONiC (#8678) 2021-10-26 12:52:03 -07:00
platform-modules-s5212f.postinst Added Support for Dell EMC S5212f in SONiC (#8678) 2021-10-26 12:52:03 -07:00
platform-modules-s5224f.init DellEMC: Initial commit for S5224F platform support (#8717) 2021-09-26 09:34:16 -07:00
platform-modules-s5224f.install DellEMC: Initial commit for S5224F platform support (#8717) 2021-09-26 09:34:16 -07:00
platform-modules-s5224f.postinst DellEMC: Initial commit for S5224F platform support (#8717) 2021-09-26 09:34:16 -07:00
platform-modules-s5232f.init [devices]: Add a new supported device DellEMC s5232f (#3090) 2019-06-28 21:40:50 -07:00
platform-modules-s5232f.install Update SAI modules for Nokia and Juniper for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
platform-modules-s5232f.postinst [devices]: Add a new supported device DellEMC s5232f (#3090) 2019-06-28 21:40:50 -07:00
platform-modules-s5248f.init [device]: Add a new supported device DellEMC s5248f (#3547) 2019-10-17 18:43:59 -07:00
platform-modules-s5248f.install DellEMC: S5248F - Platform API 2.0 implementation (#7930) 2021-06-28 09:44:49 -07:00
platform-modules-s5248f.postinst [device]: Add a new supported device DellEMC s5248f (#3547) 2019-10-17 18:43:59 -07:00
platform-modules-s5296f.init [devices]: DellEMC new platform support for DellEMC s5296f- 96x25G (#3960) 2020-10-21 11:10:50 -07:00
platform-modules-s5296f.install DellEMC: S5296F Platform API 2.0 changes (#11162) 2022-08-25 17:07:23 -07:00
platform-modules-s5296f.postinst [devices]: DellEMC new platform support for DellEMC s5296f- 96x25G (#3960) 2020-10-21 11:10:50 -07:00
platform-modules-s6000.init [DELLEMC][S6000] Platform 2.0 Reboot Reason and fixed issue in process-reboot-cause (#3156) 2019-07-24 12:15:46 -07:00
platform-modules-s6000.install [DellEMC S6000]: Move fan control to thermalctld from fancontrol.sh (#7239) 2021-12-08 10:43:14 -08:00
platform-modules-s6000.postinst [DellEMC S6000]: Move fan control to thermalctld from fancontrol.sh (#7239) 2021-12-08 10:43:14 -08:00
platform-modules-s6100.install [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
platform-modules-s6100.postinst [DellEMC] S6100 Platform Service optimization porting in master (#11330) 2022-08-02 09:56:17 -07:00
platform-modules-z9100.init [platform]: move dell platform modules into buildimage repo 2018-08-13 10:39:07 +00:00
platform-modules-z9100.install Update SAI modules for Nokia and Juniper for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
platform-modules-z9100.postinst [devices]: Poller to detect Intel Rangely LPC failure for dell z9100/s6100 (#3065) 2019-06-24 08:13:40 -07:00
platform-modules-z9264f.init Z9264f-LED_changes (#3376) 2019-08-23 12:00:37 -07:00
platform-modules-z9264f.install Update SAI modules for Nokia and Juniper for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
platform-modules-z9264f.postinst [devices]: Dell z9264f bringup (#2415) 2019-01-08 21:14:18 -08:00
platform-modules-z9332f.init DellEMC: Add support for new platform z9332f -32x400G (#3845) 2019-12-17 15:26:23 -08:00
platform-modules-z9332f.install DellEMC: Z9332f - Graceful platform reboot (#10240) 2022-08-30 11:23:52 -07:00
platform-modules-z9332f.postinst DellEMC: Add support for new platform z9332f -32x400G (#3845) 2019-12-17 15:26:23 -08:00
platform-modules-z9432f.init DellEMC: Initial commit for Z9432F platform (#10640) 2022-06-15 09:39:41 -07:00
platform-modules-z9432f.install DellEMC: Initial commit for Z9432F platform (#10640) 2022-06-15 09:39:41 -07:00
platform-modules-z9432f.postinst DellEMC: Initial commit for Z9432F platform (#10640) 2022-06-15 09:39:41 -07:00
rules DellEMC: S5296F Platform API 2.0 changes (#11162) 2022-08-25 17:07:23 -07:00