Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[service] introducing serial port watchdog service #1743

Merged
merged 4 commits into from
May 25, 2018

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented May 25, 2018

- What I did
Introducing a serial port watchdog service. The service watches the processes running off the serial
console port. If a process is observed stuck without IO proceeding for too long, the service will
try to kill the process.

- How to verify it
The test was done in a few separate part:

  1. The serial-port-watchdog.py script: on devices that has known stuck process. run the script and the script killed these stuck processes after timing out. leaving evidences in syslog.
  2. Service was installed and started on my dut.
  3. After killing the script, service restarted it right away.
  4. When adding/modifying installer.conf, the watched serial port changes accordingly.

yxieca added 4 commits May 25, 2018 15:07
Monitor serial port processes. Kill ones stuck for too long.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@yxieca yxieca requested a review from lguohan May 25, 2018 15:13
@yxieca
Copy link
Contributor Author

yxieca commented May 25, 2018

We have some going discussion on the baud-rate PR. I refactored the rc.local changes, putting infrastructure changes in separate commits. So either one could check in independently and leave minimum change for the other PR.

@yxieca yxieca merged commit bb6ff62 into sonic-net:master May 25, 2018
@yxieca yxieca deleted the watchdog branch May 25, 2018 17:52
lguohan pushed a commit that referenced this pull request May 26, 2018
* [rc.local] refactor platform identification code to separate function

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [rc.local] infrastructure to take action according to installer.conf

* [serial port watchdog] add service to watch serial port processes

Monitor serial port processes. Kill ones stuck for too long.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [rc.local] start watchdog on serial port specified by installer.conf

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
[Unit]
Description=Monitor serial port processes, kill stuck ones
Requires=
After=rc.local.Service
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S [](start = 15, length = 1)

lower case S?

{
sed -i "s|ttyS.|ttyS$CONSOLE_DEV|g" /etc/systemd/system/serial-port-watchdog.service
systemctl daemon-reload
systemctl restart serial-port-watchdog.service
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serial-port-watchdog.service [](start = 22, length = 28)

Deadlock between rc.local and serial-port-watchdog?

qiluo-msft added a commit to qiluo-msft/sonic-buildimage that referenced this pull request Jun 5, 2018
qiluo-msft added a commit that referenced this pull request Jun 5, 2018
* Revert "[serial watchdog] remove serial watchdog service dependency to rc.local (#1752)"
* Revert "[service] introducing serial port watchdog service (#1743)"
lguohan pushed a commit that referenced this pull request Jun 5, 2018
* Revert "[serial watchdog] remove serial watchdog service dependency to rc.local (#1752)"
* Revert "[service] introducing serial port watchdog service (#1743)"
theasianpianist pushed a commit to theasianpianist/sonic-buildimage that referenced this pull request Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants