Merge pull request #6679 from Icinga/bugfix/initialize-initrundir-constant-on-windows

Initialize Configuration::InitRunDir for Windows and writing the PID file
This commit is contained in:
Michael Friedrich 2018-10-15 09:38:35 +02:00 committed by GitHub
commit db322ebce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

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