aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-03-07 11:26:58 +0100
committerLukas Larsson <[email protected]>2018-03-07 11:26:58 +0100
commiteec60603d76f0e3a12d1f7238ac5e829a17e9696 (patch)
tree23854dc4407dab128cc93fb0d84a869f5350db91
parent41a22ab0ad052253df06bc76b242ab25faf8804d (diff)
parentcff8dce026edfa86d0c96aebfbb8af53fee238a6 (diff)
downloadotp-eec60603d76f0e3a12d1f7238ac5e829a17e9696.tar.gz
otp-eec60603d76f0e3a12d1f7238ac5e829a17e9696.tar.bz2
otp-eec60603d76f0e3a12d1f7238ac5e829a17e9696.zip
Merge branch 'lukas/erts/erl_child_setup_ignore_SIGTERM/OTP-14943'
* lukas/erts/erl_child_setup_ignore_SIGTERM/OTP-14943: erts: Ignore SIGTERM in erl_child_setup
-rw-r--r--erts/emulator/sys/unix/erl_child_setup.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c
index 69fc6c2879..57973b10d7 100644
--- a/erts/emulator/sys/unix/erl_child_setup.c
+++ b/erts/emulator/sys/unix/erl_child_setup.c
@@ -437,6 +437,21 @@ main(int argc, char *argv[])
exit(1);
}
+ /* Ignore SIGTERM.
+ Some container environments send SIGTERM to all processes
+ when terminating. We don't want erl_child_setup to terminate
+ in these cases as that will prevent beam from properly
+ cleaning up.
+ */
+ sa.sa_handler = SIG_IGN;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+
+ if (sigaction(SIGTERM, &sa, 0) == -1) {
+ perror(NULL);
+ exit(1);
+ }
+
forker_hash_init();
SET_CLOEXEC(uds_fd);