diff options
author | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2021-03-18 07:56:59 +0100 |
---|---|---|
committer | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2021-05-27 21:30:19 +0200 |
commit | 25cd313cfb1f29f179319daf81de63e989d442a7 (patch) | |
tree | 0641ffeac604a79a474e75c84eba177905367ef5 /src | |
parent | cdee66a2abd6e3f2da6efc36f8efd4b5dd46ce4c (diff) |
Handle SIGINT as we do with SIGTERM
(cherry picked from commit cdc5c672e1c309294626cd5ed90acdccb05baaa1)
(cherry picked from commit f9c8211fb0ad0dd362f471978a5e0abc5dfa71b4)
Diffstat (limited to 'src')
-rw-r--r-- | src/src/daemon.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/src/daemon.c b/src/src/daemon.c index 0b39fd555..ed7d30a16 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -471,6 +471,7 @@ if (pid == 0) signal(SIGCHLD, SIG_IGN); #endif signal(SIGTERM, SIG_DFL); + signal(SIGINT, SIG_DFL); /* Attempt to get an id from the sending machine via the RFC 1413 protocol. We do this in the sub-process in order not to hold up the @@ -697,6 +698,7 @@ if (pid == 0) signal(SIGHUP, SIG_DFL); signal(SIGCHLD, SIG_DFL); signal(SIGTERM, SIG_DFL); + signal(SIGINT, SIG_DFL); if (geteuid() != root_uid && !deliver_drop_privilege) { @@ -985,7 +987,7 @@ daemon_die(void) { int pid; -DEBUG(D_any) debug_printf("SIGTERM seen\n"); +DEBUG(D_any) debug_printf("SIGTERM/SIGINT seen\n"); #if !defined(DISABLE_TLS) && (defined(EXIM_HAVE_INOTIFY) || defined(EXIM_HAVE_KEVENT)) tls_watch_invalidate(); #endif @@ -1891,6 +1893,7 @@ os_non_restarting_signal(SIGCHLD, main_sigchld_handler); sigterm_seen = FALSE; os_non_restarting_signal(SIGTERM, main_sigterm_handler); +os_non_restarting_signal(SIGINT, main_sigterm_handler); /* If we are to run the queue periodically, pretend the alarm has just gone off. This will cause the first queue-runner to get kicked off straight away. */ @@ -2178,6 +2181,7 @@ for (;;) signal(SIGHUP, SIG_DFL); signal(SIGCHLD, SIG_DFL); signal(SIGTERM, SIG_DFL); + signal(SIGINT, SIG_DFL); /* Re-exec if privilege has been given up, unless deliver_drop_ privilege is set. Reset SIGALRM before exec(). */ |