sonic-buildimage/platform/broadcom
Hua Liu 5206fcd097
[S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. (#14402) (#15032)
[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-05-17 13:09:04 -07:00
..
docker-saiserver-brcm [SAIServer]Upgrade SAI server init script (#13175) 2023-01-01 13:47:44 +08:00
docker-syncd-brcm [202205] Remove apt package lists and make macro to clean up apt and python cache (#14377) 2023-03-22 14:51:25 -07:00
docker-syncd-brcm-dnx [202205] Remove apt package lists and make macro to clean up apt and python cache (#14377) 2023-03-22 14:51:25 -07:00
docker-syncd-brcm-dnx-rpc Upgrade broadcom platform containers(syncd/ saiserver/ syncd-rpc/ syncd-dnx-rpc) to bullseye (#10864) 2022-08-11 16:16:42 +00:00
docker-syncd-brcm-rpc Revert "[SAI PTF][202205]Support sai ptf v2 Syncd-rpc (#12763)" (#12785) 2022-11-21 20:48:24 -08:00
saibcm-modules [sflow]: Unblocked psample_*() function calls in BRCM ESW platforms for proper functionality of sflow feature (#12918) (#13001) 2022-12-09 03:40:48 +08:00
saibcm-modules-dnx@af0ed840c7 [202205] Update Linux kernel from 5.10.103 to 5.10.140 (#12660) #12874 2022-12-01 09:25:40 -08:00
sonic-platform-modules-accton [AS9716-32D] Support i2c mux reset (#10492) 2022-04-09 10:51:49 -07:00
sonic-platform-modules-alphanetworks [202205] Update Linux kernel from 5.10.103 to 5.10.140 (#12660) #12874 2022-12-01 09:25:40 -08:00
sonic-platform-modules-arista@818cebb5c9 [202205][Arista] Update platform library submodules (#14829) 2023-05-03 17:08:55 -07:00
sonic-platform-modules-brcm-xlr-gts [build]: fix dpkg admindir corruption issue in parallel build (#6408) 2021-01-12 06:03:12 -08:00
sonic-platform-modules-cel Fix Belgite platform issues (#14035) 2023-03-15 19:29:00 +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) (#15032) 2023-05-17 13:09:04 -07:00
sonic-platform-modules-delta [sonic-linux-kernel]: security update to kernel 4.19.152 (#6490) 2021-02-06 21:02:06 -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 [SFP-Refactor] Modify transceiver key name (#9447) 2021-12-09 12:38:45 +05:30
sonic-platform-modules-juniper Update SAI modules for Nokia and Juniper for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
sonic-platform-modules-mitac [sonic-linux-kernel]: security update to kernel 4.19.152 (#6490) 2021-02-06 21:02:06 -08:00
sonic-platform-modules-nokia@b027ce0fbc [Nokia7250][sonic-platform] Update sonic-platform submodule for Nokia-7150IXRE platform (#14548) 2023-05-17 12:32:37 +08:00
sonic-platform-modules-quanta [SFP-Refactor] Modify transceiver key name (#9447) 2021-12-09 12:38:45 +05:30
sonic-platform-modules-ragile [ragile] support 32c and 4s platform (#8824) 2021-11-17 23:49:06 -08:00
sonic-platform-modules-ruijie [SFP-Refactor] Modify transceiver key name (#9447) 2021-12-09 12:38:45 +05:30
docker-pde.dep [PDE]: introduce the SONiC Platform Development Env (#7510) 2021-07-24 16:24:43 -07:00
docker-pde.mk PDE migration to bullseye (#10836) 2022-08-11 23:14:10 +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 [SAIServer]Upgrade SAI server init script (#13175) 2023-01-01 13:47:44 +08:00
docker-syncd-brcm-dnx-rpc.dep New sonic-buildimage images for Broadcom DNX ASIC family. (#7598) 2021-06-22 11:12:22 -07:00
docker-syncd-brcm-dnx-rpc.mk Upgrade broadcom platform containers(syncd/ saiserver/ syncd-rpc/ syncd-dnx-rpc) to bullseye (#10864) 2022-08-11 16:16:42 +00:00
docker-syncd-brcm-dnx.dep New sonic-buildimage images for Broadcom DNX ASIC family. (#7598) 2021-06-22 11:12:22 -07:00
docker-syncd-brcm-dnx.mk Upgrade broadcom platform containers(syncd/ saiserver/ syncd-rpc/ syncd-dnx-rpc) to bullseye (#10864) 2022-08-11 16:16:42 +00: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 Revert "[SAI PTF][202205]Support sai ptf v2 Syncd-rpc (#12763)" (#12785) 2022-11-21 20:48:24 -08:00
docker-syncd-brcm.dep [build]: Fix syncd dpkg cache dependency issue (#6680) 2021-02-04 09:03:14 -08:00
docker-syncd-brcm.mk Upgrade broadcom platform containers(syncd/ saiserver/ syncd-rpc/ syncd-dnx-rpc) to bullseye (#10864) 2022-08-11 16:16:42 +00:00
libsaithrift-dev.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
libsaithrift-dev.mk [202205][Submodule][SAI-Redis]Advance SAI Redis head pointer (#13156) 2022-12-25 10:17:34 +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 driver submodules (#9393) 2021-12-08 11:33:36 -08:00
one-image.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
one-image.mk Add belgite support (#9511) 2022-05-23 18:45:37 -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 Fix for Accton platform build failure when doing incremental build (#10541) 2022-05-09 12:17:38 -07:00
platform-modules-alphanetworks.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-alphanetworks.mk [Alphanetworks] Add new platform SNJ60D0-320F (#8780) 2021-10-22 12:37:39 -07:00
platform-modules-arista.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-arista.mk [Arista] Update driver submodules (#9393) 2021-12-08 11:33:36 -08: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 Add belgite support (#9511) 2022-05-23 18:45:37 -07:00
platform-modules-dell.dep [build]: support for DPKG local caching (#4117) 2020-03-11 20:04:52 -07:00
platform-modules-dell.mk Added Support for Dell EMC S5212f in SONiC (#8678) 2021-10-26 12:52:03 -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-nokia.dep Added Nokia IXR7250E support (#7809) 2021-08-17 12:26:04 -07:00
platform-modules-nokia.mk Added Nokia IXR7250E support (#7809) 2021-08-17 12:26:04 -07: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-21 09:24:41 -07:00
platform-modules-ragile.dep [Platform/Ragile] Support RA-B6510-48v8c platform (#7620) 2021-06-03 10:51:01 -07:00
platform-modules-ragile.mk [ragile] support 32c and 4s platform (#8824) 2021-11-17 23:49:06 -08:00
platform-modules-ruijie.dep [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
platform-modules-ruijie.mk [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08: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 Flashrom refactoring for broadcom platforms (#7693) 2021-06-22 15:29:21 -07:00
rules.dep [gbsyncd] Build docker-gbsyncd-broncos image (#11748) 2022-09-01 00:01:35 +00:00
rules.mk [gbsyncd] Build docker-gbsyncd-broncos image (#11748) 2022-09-01 00:01:35 +00:00
sai-modules.dep [build]: Update the make cache mode for opennsl-module-dnx (#8391) 2021-08-10 07:27:01 -07:00
sai-modules.mk [sonic-sairedis update] Support for SAI header v1.10.2 with BRCM SAI v7.1.0.0 and MLNX SAI v1.21.1.0 (#10583) 2022-05-05 20:27:29 -07:00
sai.dep [202205][BRCM_SAI] update Brcm SAI dependencies (#11173) 2022-06-17 05:02:00 -07:00
sai.mk [202205] Update Broadcom SAI version to 7.1.42.4 (#14555) 2023-04-13 14:11:33 -07:00
sonic-pde-tests.dep [PDE]: introduce the SONiC Platform Development Env (#7510) 2021-07-24 16:24:43 -07:00
sonic-pde-tests.mk [202205][BRCM_SAI] update Brcm SAI dependencies (#11173) 2022-06-17 05:02:00 -07:00