]> granicus.if.org Git - icinga2/commitdiff
Initialize Configuration::InitRunDir for Windows and writing the PID file 6679/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 12 Oct 2018 14:18:55 +0000 (16:18 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 15 Oct 2018 07:24:46 +0000 (09:24 +0200)
Even if this some Unix specific stuff, we rely on writing this file
in our generic application code. Therefore its path needs to be specified.

This got broken with 9fbc406 which renamed RunDir to InitRunDir, but
didn't re-add it to the Windows #ifdefs.

fixes #6677

icinga-app/icinga.cpp

index a2bf8001c5e26152f8e38c0e78d0567277cf31e6..040e35e957a1ee47972beadef703dc4ccb50884c 100644 (file)
@@ -200,7 +200,6 @@ static int Main()
        String dataPrefix = Utility::GetIcingaDataPath();
 
        if (!binaryPrefix.IsEmpty() && !dataPrefix.IsEmpty()) {
-               Configuration::PrefixDir = binaryPrefix;
                Configuration::ProgramData = dataPrefix;
 
                Configuration::ConfigDir = dataPrefix + "\\etc\\icinga2";
@@ -210,9 +209,13 @@ static int Main()
                Configuration::CacheDir = dataPrefix + "\\var\\cache\\icinga2";
                Configuration::SpoolDir = dataPrefix + "\\var\\spool\\icinga2";
 
+               Configuration::PrefixDir = binaryPrefix;
+
                /* Internal constants. */
                Configuration::PkgDataDir = binaryPrefix + "\\share\\icinga2";
                Configuration::IncludeConfDir = binaryPrefix + "\\share\\icinga2\\include";
+
+               Configuration::InitRunDir = dataPrefix + "\\var\\run\\icinga2";
        } else {
                Log(LogWarning, "icinga-app", "Registry key could not be read. Falling back to built-in paths.");