commit - 62e001b06778c96d0deebceddf1913f7b57ab2d6
commit + 1d3eb470b0e5961d74cf202567a0e4c0b57f7f12
blob - 0714df4fea4e5001d15aa169e1e48cb871da36fb
blob + cedcc937bf8451b812c4f58e807b31177fb63501
--- gmid.c
+++ gmid.c
tls_config_free(tlsconf);
}
-static void
-wait_sighup(void)
+static int
+wait_signal(void)
{
sigset_t mask;
int signo;
sigemptyset(&mask);
sigaddset(&mask, SIGHUP);
+ sigaddset(&mask, SIGINT);
+ sigaddset(&mask, SIGTERM);
sigwait(&mask, &signo);
+
+ return signo == SIGHUP;
}
void
close(p[1]);
imsg_init(&exibuf, p[0]);
- wait_sighup();
+ if (!wait_signal())
+ break;
+
log_info(NULL, "reloading configuration %s", config_path);
/* close the executor (it'll close the servers too) */
if (sock6 == -1 && conf.ipv6)
sock6 = make_socket(conf.port, AF_INET6);
}
+
+ imsg_compose(&exibuf, IMSG_QUIT, 0, 0, -1, NULL, 0);
+ imsg_flush(&exibuf);
+
+ imsg_compose(&logibuf, IMSG_QUIT, 0, 0, -1, NULL, 0);
+ imsg_flush(&logibuf);
+
+ return 0;
}