From: Maxim Mamontov Date: Wed, 16 Mar 2016 20:24:07 +0000 (+0200) Subject: Un-ignore SIGHUP by default. X-Git-Tag: 2.409~174^2~2 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/f6b42411f8193b918e00d06551ed85985913ffa1?ds=inline;hp=72635da73fc450b040d72fbeca4becd73c99008d Un-ignore SIGHUP by default. --- diff --git a/projects/stargazer/main.cpp b/projects/stargazer/main.cpp index 3c216977..de047687 100644 --- a/projects/stargazer/main.cpp +++ b/projects/stargazer/main.cpp @@ -266,6 +266,11 @@ for (size_t i = 0; i < settings.GetExecutersNum(); i++) PIDFile pidFile(settings.GetPIDFileName()); +struct sigaction sa; +memset(&sa, 0, sizeof(sa)); +sa.sa_handler = SIG_DFL; +sigaction(SIGHUP, &sa, NULL); // Apparently FreeBSD ignores SIGHUP by default when launched from rc.d at bot time. + sigset_t signalSet; sigfillset(&signalSet); pthread_sigmask(SIG_BLOCK, &signalSet, NULL);