]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: If idle-die callback returns FALSE, notify master that we don't want...
authorTimo Sirainen <tss@iki.fi>
Mon, 17 Aug 2015 09:53:52 +0000 (12:53 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 17 Aug 2015 09:53:52 +0000 (12:53 +0300)
This avoids the master thinking that we're ignoring its idle-kill signal and
logging an error.

src/lib-master/master-service.c

index 7c22f743550d3d6848cad2c68cc4c35df05c8edb..eac7d3d1af8cf270754f49c7bb0bbb7925e32072 100644 (file)
@@ -45,6 +45,8 @@ struct master_service *master_service;
 
 static void master_service_io_listeners_close(struct master_service *service);
 static void master_service_refresh_login_state(struct master_service *service);
+static void
+master_status_send(struct master_service *service, bool important_update);
 
 const char *master_service_getopt_string(void)
 {
@@ -73,8 +75,12 @@ static void sig_die(const siginfo_t *si, void *context)
                        return;
 
                if (service->idle_die_callback != NULL &&
-                   !service->idle_die_callback())
+                   !service->idle_die_callback()) {
+                       /* we don't want to die - send a notification to master
+                          so it doesn't think we're ignoring it completely. */
+                       master_status_send(service, FALSE);
                        return;
+               }
        }
 
        service->killed = TRUE;