mirror of https://github.com/Icinga/icinga2.git
parent
978d707e3b
commit
bd2c266bf1
|
@ -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 <https://github.com/Icinga/icinga2>" << std::endl
|
||||
<< "Get support: <https://www.icinga.com/support/>" << std::endl
|
||||
<< "Icinga home page: <https://www.icinga.com/>" << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue