How does rancher kill/restart containers

I would like to know how rancher kills/restart containers, do you send a SIGHUP or do you just force kill the containers?
We have an application that really needs a SIGHUP to gracefully shutdown. I haven’t looked that much into it and maybe docker takes care of it?

I know this question is old, but I also really need to know this. I cannot find any documentation about how Rancher stops/restarts/upgrades containers. Does it send a signal like SIGHUP, SIGTERM, or SIGINT? Is there some kind of timeout period? Does it kill the container even if the underlying process is still running? All of this information is absolutely critical for using Rancher in a serious, production context.

We call the docker remote API and do nothing special. The defaults are SIGTERM (stopSignal), wait ten seconds (stopTimeout), then SIGKILL.

1 Like

Thanks for the quick reply @vincent. Is that process also used for upgrades?

Yes; that default behavior has always been the case, the ability to change them in API/compose is fairly new, and only in the upcoming 2.0 UI.

Great. Can we add this to the documentation at Is that something I can do?

We don’t generally document standard Docker behavior…

But the docs are a Jekyll repo:

I don’t think it’s necessary to repeat anything that already exists on, but at least mentioning that Rancher uses the remote docker API and inherits those defaults (and maybe even linking to the relevant pages on would go a long way toward helping people like me understand what actually happens when you stop/restart/upgrade services with Rancher. The existing documentation doesn’t elaborate any further than saying Rancher “stops the existing containers”. If you have been using Rancher for a while or working on Rancher/Cattle internals, it probably seems obvious what that means but it was not obvious to me as a newcomer.

Anyways, thanks for your reply. I was able to solve the issue and set up graceful shutdowns for our application. I might move the discussion about docs to if I have time later.