diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index 31f6dc3d4..c822d9351 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -154,6 +154,13 @@ int Main(void) Application::DeclareZonesDir(Application::GetSysconfDir() + "/icinga2/zones.d"); +#ifndef _WIN32 + if (!Utility::PathExists(Application::GetSysconfigFile())) { + Log(LogWarning, "icinga-app") + << "Sysconfig file '" << Application::GetSysconfigFile() << "' cannot be read. Using default values."; + } +#endif /* _WIN32 */ + String icingaUser = Utility::GetFromSysconfig("ICINGA2_USER"); if (icingaUser.IsEmpty()) icingaUser = ICINGA_USER; @@ -468,6 +475,7 @@ int Main(void) std::cout << visibleDesc << std::endl << "Report bugs at " << std::endl + << "Get support: " << std::endl << "Icinga home page: " << std::endl; return EXIT_SUCCESS; } diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index 9aaddb8ba..cd2e2bf0d 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -1958,6 +1958,9 @@ String Utility::GetFromSysconfig(const String& env) if (sysconf.IsEmpty()) return ""; + if (!Utility::PathExists(sysconf)) + return ""; + String cmdInner = ". " + EscapeShellArg(sysconf) + " 2>&1 >/dev/null;echo \"$" + env + "\""; String cmd = "sh -c " + EscapeShellArg(cmdInner);