From 45a4a46333b1e8e6f66ba923deaf947a67ae7737 Mon Sep 17 00:00:00 2001 From: Simon Cornish <7t9jna402@sneakemail.com> Date: Mon, 25 Apr 2016 22:21:07 -0700 Subject: Don't kill old erlang if HEART_NO_KILL is set If the environment variable HEART_NO_KILL is set then heart won't kill the old erlang process. This is desirable if the command executed by heart takes care of this. --- erts/etc/common/heart.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'erts/etc/common') diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c index 1a826221fb..b6fbfd075c 100644 --- a/erts/etc/common/heart.c +++ b/erts/etc/common/heart.c @@ -119,6 +119,8 @@ #define HEART_COMMAND_ENV "HEART_COMMAND" #define ERL_CRASH_DUMP_SECONDS_ENV "ERL_CRASH_DUMP_SECONDS" #define HEART_KILL_SIGNAL "HEART_KILL_SIGNAL" +#define HEART_NO_KILL "HEART_NO_KILL" + #define MSG_HDR_SIZE (2) #define MSG_HDR_PLUS_OP_SIZE (3) @@ -524,6 +526,10 @@ static void kill_old_erlang(void){ HANDLE erlh; DWORD exit_code; + + if (is_env_set(HEART_NO_KILL)) + return; + if(heart_beat_kill_pid != 0){ if((erlh = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE | @@ -557,6 +563,9 @@ kill_old_erlang(void){ int sig = SIGKILL; char *sigenv = NULL; + if (is_env_set(HEART_NO_KILL)) + return; + sigenv = get_env(HEART_KILL_SIGNAL); if (sigenv && strcmp(sigenv, "SIGABRT") == 0) { print_error("kill signal SIGABRT requested"); -- cgit v1.2.3