mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
parent
6ac851ca10
commit
e9fddcc575
@ -280,22 +280,20 @@ void Application::StartReloadProcess(void) const
|
|||||||
Log(LogInformation, "base", "Got reload command: Starting new instance.");
|
Log(LogInformation, "base", "Got reload command: Starting new instance.");
|
||||||
|
|
||||||
// prepare arguments
|
// prepare arguments
|
||||||
std::vector<String> args;
|
Array::Ptr args = make_shared<Array>();
|
||||||
args.push_back(GetExePath(m_ArgV[0]));
|
args->Add(GetExePath(m_ArgV[0]));
|
||||||
|
|
||||||
for (int i=1; i < Application::GetArgC(); i++) {
|
for (int i=1; i < Application::GetArgC(); i++) {
|
||||||
if (std::string(Application::GetArgV()[i]) != "--reload-internal")
|
if (std::string(Application::GetArgV()[i]) != "--reload-internal")
|
||||||
args.push_back(Application::GetArgV()[i]);
|
args->Add(Application::GetArgV()[i]);
|
||||||
else
|
else
|
||||||
i++; // the next parameter after --reload-internal is the pid, remove that too
|
i++; // the next parameter after --reload-internal is the pid, remove that too
|
||||||
}
|
}
|
||||||
args.push_back("--reload-internal");
|
args->Add("--reload-internal");
|
||||||
args.push_back(Convert::ToString(Utility::GetPid()));
|
args->Add(Convert::ToString(Utility::GetPid()));
|
||||||
|
|
||||||
Process::Ptr process = make_shared<Process>(args);
|
|
||||||
|
|
||||||
|
Process::Ptr process = make_shared<Process>(Process::PrepareCommand(args));
|
||||||
process->SetTimeout(300);
|
process->SetTimeout(300);
|
||||||
|
|
||||||
process->Run(boost::bind(&Application::ReloadProcessCallback, _1));
|
process->Run(boost::bind(&Application::ReloadProcessCallback, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user