diff options
author | Lukas Larsson <[email protected]> | 2018-02-16 09:55:08 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2018-02-16 09:57:15 +0100 |
commit | cff8dce026edfa86d0c96aebfbb8af53fee238a6 (patch) | |
tree | 2c01cb472b0b1788b218db1eb8c5332fdf923e0d /erts/emulator/sys | |
parent | 9e7b328be93eccaabaf22ff8081772031731026e (diff) | |
download | otp-cff8dce026edfa86d0c96aebfbb8af53fee238a6.tar.gz otp-cff8dce026edfa86d0c96aebfbb8af53fee238a6.tar.bz2 otp-cff8dce026edfa86d0c96aebfbb8af53fee238a6.zip |
erts: Ignore SIGTERM in erl_child_setup
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r-- | erts/emulator/sys/unix/erl_child_setup.c | 15 |
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); |