mirror of https://github.com/Icinga/icinga2.git
Inherit parent process arguments for defined path constants
This commit is contained in:
parent
e545884952
commit
e3e68caaa3
|
@ -394,15 +394,24 @@ void ApiListener::AsyncTryActivateZonesStage(const String& stageConfigDir, const
|
|||
{
|
||||
VERIFY(Application::GetArgC() >= 1);
|
||||
|
||||
// prepare arguments
|
||||
/* Inherit parent process args. */
|
||||
Array::Ptr args = new Array({
|
||||
Application::GetExePath(Application::GetArgV()[0]),
|
||||
"daemon",
|
||||
"--validate",
|
||||
"--define",
|
||||
"System.ZonesStageVarDir='" + GetApiZonesStageDir() + "'" //Path is written onto the shell
|
||||
});
|
||||
|
||||
for (int i = 1; i < Application::GetArgC(); i++) {
|
||||
String argV = Application::GetArgV()[i];
|
||||
|
||||
if (argV == "-d" || argV == "--daemonize")
|
||||
continue;
|
||||
|
||||
args->Add(argV);
|
||||
}
|
||||
|
||||
args->Add("--validate");
|
||||
args->Add("--define");
|
||||
args->Add("System.ZonesStageVarDir='" + GetApiZonesStageDir() + "'");
|
||||
|
||||
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
||||
process->SetTimeout(300);
|
||||
process->Run(std::bind(&TryActivateZonesStageCallback, _1, stageConfigDir, currentConfigDir, relativePaths, reload));
|
||||
|
|
Loading…
Reference in New Issue