-
Notifications
You must be signed in to change notification settings - Fork 664
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
[fast-reboot] Stop services after killing containers to prevent automatic restart #572
[fast-reboot] Stop services after killing containers to prevent automatic restart #572
Conversation
I can see similiar commands in sonic_installer, can you check them as well?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as comments
sonic_installer does have calls to |
what if the service is going to be restarted before it was stopped? |
Retest this please |
@pavel-shirshov: If someone or something had called |
@jleveque
So I think if we don't fast enough to stop the container, but supervisorctl restarted just killed processes already? |
These processes are not set to be restarted by supervisor inside the containers. The restart mechanism uses a supervisor event listener to listen for processes exiting, which then causes supervisor to exit and subsequently the container itself. Then, systemd will restart the entire container. Here we're killing the container, then stopping the systemd service to prevent it from restarting the container. |
Retest this please |
1 similar comment
Retest this please |
@jleveque Got it |
- What I did
Explicitly stop corresponding services after killing Docker containers to prevent the service from automatically restarting the container during fast-/warm-reboot.
We are beginning to configure the services which control Docker containers to automatically restart the service and all dependent services if the container should ever stop. In the case of fast-/warm-reboot, stopping the service could require up to 10 seconds to stop the container (due to the behavior of the underlying
docker stop
command). This could take too long, so in this script we calldocker kill
, which will work faster. However, after killing the container, the service which controls the container (once configured to restart) will restart the container after the specified interval, but we do not want the behavior under these fast-/warm-reboot circumstances. The services will be restarted after completing the reboot. Therefore, we stop the service immediately after killing the corresponding container to ensure the service cannot automatically restart the container.