From 81b62880e3768dcd161f107f766f3e6e89d59446 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 19 May 2017 09:44:11 +0200 Subject: erts: Add undocumented option to do default SIGTERM This is a stopgap measure before the release of OTP-20 where that makes it possible for the user to make the vm not do anything with SIGTERM and instead rely on the OS default. To enable this behaviour the user should set the environment variable ERL_ZZ_SIGTERM_KILL="true". --- erts/emulator/sys/unix/sys.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index 3010af44be..de8481b206 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -838,6 +838,11 @@ void sys_init_suspend_handler(void) void erts_sys_unix_later_init(void) { + char env[4]; + size_t envsz = sizeof(env); + if (erts_sys_getenv_raw("ERL_ZZ_SIGTERM_KILL", env, &envsz) == 0) + if (envsz == 4 && sys_strncmp("true",env,4) == 0) + return; sys_signal(SIGTERM, request_stop); } -- cgit v1.2.3