Ensure the daemon doesn't get killed by logrotate

refs #8050
This commit is contained in:
Alexander A. Klimov 2020-08-11 15:47:57 +02:00
parent e9b8fc234b
commit ffdaf134c9

View File

@ -367,6 +367,9 @@ static void UmbrellaSignalHandler(int num, siginfo_t *info, void*)
static void WorkerSignalHandler(int num, siginfo_t *info, void*)
{
switch (num) {
case SIGUSR1:
// Not ready, yet
break;
case SIGUSR2:
if (info->si_pid == l_UmbrellaPid) {
// The umbrella process allowed us to continue working beyond config validation
@ -459,6 +462,7 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs, bool close
sa.sa_sigaction = &WorkerSignalHandler;
sa.sa_flags = SA_RESTART | SA_SIGINFO;
(void)sigaction(SIGUSR1, &sa, nullptr);
(void)sigaction(SIGUSR2, &sa, nullptr);
(void)sigaction(SIGINT, &sa, nullptr);
(void)sigaction(SIGTERM, &sa, nullptr);