Linux – Is supervisord shutting down gracefully

linuxsupervisordUbuntu

I have process that needs arbitrary amount of time to shutdown, anywhere between 2 seconds and couple of minutes. It is important that this process exits gracefully (not killed). I use supervisord and ubuntu server to run it.

When the server get ACPI shutdown signal (reboot command from a VPS provider, that's what EC2 does I assume), will supervisord (and the whole system) wait for all the child processes to exit during shutdown sequence?

Best Answer

You should check out the following configuration options:

stopsignal to specify which signal gets sent to your program in order to tell it to stop gracefully

stopwaitsecs to specify how long supervisord should wait for the process to stop gracefully, before giving up and sending a SIGKILL.

http://supervisord.org/configuration.html#program-x-section-settings