mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7739 from sthen/workaround-openbsd-siginfo
cope with OS which don't fill in si_pid in siginfo
This commit is contained in:
commit
a55995064d
|
@ -324,14 +324,14 @@ static void UmbrellaSignalHandler(int num, siginfo_t *info, void*)
|
||||||
break;
|
break;
|
||||||
case SIGUSR2:
|
case SIGUSR2:
|
||||||
if (l_CurrentlyStartingUnixWorkerState.load() == UnixWorkerState::Pending
|
if (l_CurrentlyStartingUnixWorkerState.load() == UnixWorkerState::Pending
|
||||||
&& info->si_pid == l_CurrentlyStartingUnixWorkerPid.load()) {
|
&& (info->si_pid == 0 || info->si_pid == l_CurrentlyStartingUnixWorkerPid.load()) ) {
|
||||||
// The seemless worker currently being started by StartUnixWorker() successfully loaded its config
|
// The seemless worker currently being started by StartUnixWorker() successfully loaded its config
|
||||||
l_CurrentlyStartingUnixWorkerState.store(UnixWorkerState::LoadedConfig);
|
l_CurrentlyStartingUnixWorkerState.store(UnixWorkerState::LoadedConfig);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIGCHLD:
|
case SIGCHLD:
|
||||||
if (l_CurrentlyStartingUnixWorkerState.load() == UnixWorkerState::Pending
|
if (l_CurrentlyStartingUnixWorkerState.load() == UnixWorkerState::Pending
|
||||||
&& info->si_pid == l_CurrentlyStartingUnixWorkerPid.load()) {
|
&& (info->si_pid == 0 || info->si_pid == l_CurrentlyStartingUnixWorkerPid.load()) ) {
|
||||||
// The seemless worker currently being started by StartUnixWorker() failed
|
// The seemless worker currently being started by StartUnixWorker() failed
|
||||||
l_CurrentlyStartingUnixWorkerState.store(UnixWorkerState::Failed);
|
l_CurrentlyStartingUnixWorkerState.store(UnixWorkerState::Failed);
|
||||||
}
|
}
|
||||||
|
@ -368,14 +368,14 @@ static void WorkerSignalHandler(int num, siginfo_t *info, void*)
|
||||||
{
|
{
|
||||||
switch (num) {
|
switch (num) {
|
||||||
case SIGUSR2:
|
case SIGUSR2:
|
||||||
if (info->si_pid == l_UmbrellaPid) {
|
if (info->si_pid == 0 || info->si_pid == l_UmbrellaPid) {
|
||||||
// The umbrella process allowed us to continue working beyond config validation
|
// The umbrella process allowed us to continue working beyond config validation
|
||||||
l_AllowedToWork.store(true);
|
l_AllowedToWork.store(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
if (info->si_pid == l_UmbrellaPid) {
|
if (info->si_pid == 0 || info->si_pid == l_UmbrellaPid) {
|
||||||
// The umbrella process requested our termination
|
// The umbrella process requested our termination
|
||||||
Application::RequestShutdown();
|
Application::RequestShutdown();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue