]> granicus.if.org Git - icinga2/commitdiff
Add missing shutdown/program state dumps for SIGUSR2 reload handler 6691/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Tue, 16 Oct 2018 09:54:14 +0000 (11:54 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 16 Oct 2018 10:36:43 +0000 (12:36 +0200)
Credits to @west0rmann finding the issue and providing the initial fix.

fixes #6689
fixes #6592

lib/base/application.cpp

index 8388e720ca5c9643963c2d29181fcf17948b445f..1d6e1b4b1644acab147bb828c7f4d89970446c26 100644 (file)
@@ -751,6 +751,13 @@ void Application::SigUsr2Handler(int)
 
        instance->ClosePidFile(false);
 
+       /* Ensure to dump the program state on reload. */
+       ConfigObject::StopObjects();
+       instance->OnShutdown();
+
+       Log(LogInformation, "Application")
+               << "Reload done, parent process shutting down. Child process with PID '" << m_ReloadProcess << "' is taking over.";
+
        Exit(0);
 }