diff --git a/platform/CUnixPlatform.cpp b/platform/CUnixPlatform.cpp index 21f61710..c1210458 100644 --- a/platform/CUnixPlatform.cpp +++ b/platform/CUnixPlatform.cpp @@ -109,6 +109,13 @@ CUnixPlatform::installDaemonLogger(const char* name) int CUnixPlatform::restart(RestartFunc func, int minErrorCode) { + // rely on child to catch these signals + sigset_t sigset; + sigemptyset(&sigset); + sigaddset(&sigset, SIGINT); + sigaddset(&sigset, SIGTERM); + pthread_sigmask(SIG_BLOCK, &sigset, NULL); + for (;;) { switch (fork()) { default: