From: Timo Sirainen Date: Sun, 11 Dec 2022 21:15:09 +0000 (+0200) Subject: master: Don't wait only for log process at shutdown X-Git-Tag: 2.4.0~3286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d2f974c7a21a1caf762f4be5a01144cfbfcb41e;p=thirdparty%2Fdovecot%2Fcore.git master: Don't wait only for log process at shutdown There is 1 second wait at shutdown for processes that are still running. During this 1 second they should process SIGQUIT and close socket listeners. However, it's normal behavior for the log process to still exist at this stage, and there is no need to wait for it. --- diff --git a/src/master/service-monitor.c b/src/master/service-monitor.c index 42422330b3..a762d83c4e 100644 --- a/src/master/service-monitor.c +++ b/src/master/service-monitor.c @@ -641,8 +641,17 @@ service_list_processes_close_listeners(struct service_list *service_list) bool ret = FALSE; array_foreach_elem(&service_list->services, service) { - if (service_processes_close_listeners(service)) - ret = TRUE; + if (service_processes_close_listeners(service)) { + if (service->type != SERVICE_TYPE_LOG) + ret = TRUE; + else { + /* The log process won't stop until we close its + fds later on. Send a SIGQUIT to it anyway + just in case it's stuck for some reason, but + don't wait for it to be processed. This way + there is no unnecessary 1sec wait. */ + } + } } return ret; }