itopiz
What are the differences between stopping a release with SIGINT and SIGTERM?
Hi,
After building a release with MIX_ENV=prod mix release, we are informed of the following:
# To stop it gracefully (you may also send SIGINT/SIGTERM)
What are the differences between stopping a release with SIGINT and SIGTERM?
Most Liked
hauleth
-
SIGINT- “Sorry to interrupt you, sir, but you need to come with Us.” -
SIGTERM- “Your contract have been terminated, security will lead you out.” -
SIGKILL- BAM!!!
cnck1387
SIGINT is supposed to be related to killing a process from inputting characters on the terminal. So if you CTRL+ C'd a process, that should send a SIGINT.
I think SIGTERM is a more of a “hey, let’s shut down this process gracefully” but this is meant to be triggered by another process, such as a process manager.
SIGKILL on the other hand is a non-graceful event. The OS won’t wait for your process to run any exit routines and will just kill it on the spot. That’s what happens when you run kill -9 on a process.
itopiz
For the record, migrating from Elixir 1.10.1 to 1.10.2 fixed the problem with the Logger.
hauleth
This seems like bug in the Logger. Could you report it and I will check that out.
In general you want to use SIGTERM unless specified otherwise.
itopiz
Ok, I dug more and here is what I found:
On Unix systems, the Erlang runtime will interpret two types of signals.
SIGUSR1
A SIGUSR1 signal forces a crash dump.
SIGTERM
A SIGTERM will produce a stop message to the init process. This is equivalent to a init:stop/0 call.
Introduced in ERTS 8.3 (Erlang/OTP 19.3)
source: https://erlang.org/doc/man/erl.html#signals
So I guess, that is the documentation I was looking for.







