-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
auto-update: allow to use custom command when stopping container #14413
Comments
Thanks for reaching out, @gdesmott! What you could do is to change the generated systemd unit: Before
After
Note that customizing the generated units will leave supported territory. Any chance your workload can handle SIGTERM? That's what |
Thanks for your quick reply @vrothberg :)
Yes, I'd rather keep my own update script than doing such error-prone hacks.
I considered that, but my container has a |
@gdesmott, can you elaborate on the problems you faced trying to forward the signal? Did you run the container with That is the only idea (for a supported solution) I have at the moment. |
I did not. Will that automatically signal from |
I can't tell for sure but it's worth testing. The |
I don't think that adding hooks to podman auto-update is more useful then just running the commands before/afterwards. You can also just put this into a script:
|
@Luap99, I don't that fits the use case. The "custom stop command" should only be executed during auto-update. If there's nothing to update, nothing should happen. |
Ah, that's true. |
@gdesmott did it work using |
I didn't have a chance to test it yet. It's definitely on my TODO list but it makes take a while, so feel free to close this ticket for now if you think adding such feature does not make sense. |
Sounds good to me. Please let us know how it worked out. |
/kind feature
Description
I manually implemented a script very similar to podman-auto-update. The only thing blocking me from switching to it is the ability to use a custom command to stop the running container.
I send a request to my server telling it to set itself in "maintenance" mode so it will stop accepting new requests from clients and automatically shutdown itself when all the clients have been disconnected. This ensure seamless upgrades as clients are not disconnected right away when upgrading.
Would it be possible to have something like this with
auto-update
? Something a bit similar to watchtower's hooks may do.The text was updated successfully, but these errors were encountered: