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

[Services] Restart SNMP service upon unexpected critical process exit. #3650

Merged
merged 5 commits into from
Oct 22, 2019
Merged

[Services] Restart SNMP service upon unexpected critical process exit. #3650

merged 5 commits into from
Oct 22, 2019

Conversation

yozhao101
Copy link
Contributor

  • What I did
    Restart SNMP service if one of critical processes running in SNMP container exited or crashed abnormally.

  • How I did it
    Generally I follow the framework created by Joe to implement this feature in SNMP container.
    First, add supervisor-proc-exit-listener event listener option in Supervisord configuration file in SNMP docker container. Supervisord will read a list of critical processes for which to monitor the unexpected crashed and exited.
    Second, configure snmp.service to always auto-restart the service if it stops, with a delay of 30 seconds. Also set a rate limit of 3 restarts within 20 minutes (1200 seconds).

  • How to verify it
    On your switch device, please use docker ps command to list all running docker containers.
    Then use docker exec -it container_id /bin/bash to login target container. Typing top command
    on the shell will display all the processes dynamically and you will spot the process id of one
    of the critical processes. Finally type the command kill -9 process_id to terminate one process.
    After exiting the container, you can use watch -n 1 docker ps to dynamically see the restart
    of SNMP container.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…al processes list into dockerfile.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…upervisord conf file.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…empts to restart this container more than 3 times in 20 minutes.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…ared Makefile docker-snmp-sv2.mk.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@yozhao101 yozhao101 changed the title Restart snmp Restart SNMP service upon unexpected critical process exited. Oct 22, 2019
@yozhao101 yozhao101 changed the title Restart SNMP service upon unexpected critical process exited. Restart SNMP service upon unexpected critical process exit. Oct 22, 2019
@yozhao101 yozhao101 changed the title Restart SNMP service upon unexpected critical process exit. [Services] Restart SNMP service upon unexpected critical process exit. Oct 22, 2019
@yozhao101 yozhao101 marked this pull request as ready for review October 22, 2019 17:20
@jleveque
Copy link
Contributor

Retest vs please

@jleveque jleveque merged commit a0fbeea into sonic-net:master Oct 22, 2019
@yozhao101 yozhao101 deleted the Restart_SNMP branch October 25, 2019 17:57
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Feb 9, 2021
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.

2 participants