mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Fix config validation problem (startup.log) during /v1/config/stages API call
copy all arguments of parent process in AsyncTryActivateStage
This commit is contained in:
parent
fbf4546357
commit
816cae98fa
@ -217,12 +217,17 @@ void ConfigPackageUtility::AsyncTryActivateStage(const String& packageName, cons
|
||||
// prepare arguments
|
||||
Array::Ptr args = new Array({
|
||||
Application::GetExePath(Application::GetArgV()[0]),
|
||||
"daemon",
|
||||
"--validate",
|
||||
"--define",
|
||||
"ActiveStageOverride=" + packageName + ":" + stageName
|
||||
});
|
||||
|
||||
// copy all arguments of parent process
|
||||
for (int i=1; i < Application::GetArgC(); i++) {
|
||||
args->Add(Application::GetArgV()[i]);
|
||||
}
|
||||
// add arguments for validation
|
||||
args->Add("--validate");
|
||||
args->Add("--define");
|
||||
args->Add("ActiveStageOverride=" + packageName + ":" + stageName);
|
||||
|
||||
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
||||
process->SetTimeout(300);
|
||||
process->Run(std::bind(&TryActivateStageCallback, _1, packageName, stageName, reload));
|
||||
|
Loading…
x
Reference in New Issue
Block a user