From c3c3318b68129858727d870edb77b4ccd71fb396 Mon Sep 17 00:00:00 2001 From: Jethro Grassie Date: Sun, 11 Oct 2020 02:09:37 -0400 Subject: [PATCH] catch SIGTERM for clean exit --- src/pool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pool.c b/src/pool.c index 0b7871a..5357e6a 100644 --- a/src/pool.c +++ b/src/pool.c @@ -4030,7 +4030,7 @@ sigusr1_handler(evutil_socket_t fd, short event, void *arg) static void sigint_handler(int sig) { - signal(SIGINT, SIG_DFL); + signal(sig, SIG_DFL); exit(0); } @@ -4421,6 +4421,7 @@ int main(int argc, char **argv) log_set_udata(&mutex_log); log_set_lock(log_lock); signal(SIGINT, sigint_handler); + signal(SIGTERM, sigint_handler); signal(SIGPIPE, SIG_IGN); atexit(cleanup);