From dbb05434c6730ae4a13d5879f6df652d93cd6019 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 27 Jan 2023 20:02:58 +0000 Subject: [PATCH] Docs: add note on daemon shutdown --- doc/doc-docbook/spec.xfpt | 8 ++++++++ src/src/exim.c | 1 + 2 files changed, 9 insertions(+) diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index cc5923069..dc4e38c4a 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -2810,6 +2810,14 @@ of Exim is installed. It is not necessary to do this when other files that are referenced from the configuration (for example, alias files) are changed, because these are reread each time they are used. +.new +Either a SIGTERM or a SIGINT signal should be used to cause the daemon +to cleanly shut down. +Subprocesses handling recceiving or delivering messages, +or for scanning the queue, +will not be affected by the termination of the daemon process. +.wen + .cmdopt -bdf This option has the same effect as &%-bd%& except that it never disconnects from the controlling terminal, even when no debugging is specified. diff --git a/src/src/exim.c b/src/src/exim.c index 9072ffd54..c5de167c6 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1923,6 +1923,7 @@ signal(SIGSEGV, segv_handler); /* log faults */ /* If running in a dockerized environment, the TERM signal is only delegated to the PID 1 if we request it by setting an signal handler */ + if (getpid() == 1) signal(SIGTERM, term_handler); /* SIGHUP is used to get the daemon to reconfigure. It gets set as appropriate -- 2.30.2