mirror of https://github.com/Icinga/icinga2.git
parent
e0d4b9fb80
commit
541de0de78
|
@ -314,8 +314,8 @@ pid_t Application::StartReloadProcess(void)
|
|||
Process::Ptr process = make_shared<Process>(Process::PrepareCommand(args));
|
||||
process->SetTimeout(300);
|
||||
process->Run(&ReloadProcessCallback);
|
||||
|
||||
return process->GetHandle();
|
||||
|
||||
return process->GetPID();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -410,9 +410,10 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
|
|||
|
||||
m_Process = pi.hProcess;
|
||||
m_FD = outReadPipe;
|
||||
m_PID = pi.dwProcessId;
|
||||
|
||||
Log(LogInformation, "base", "Running command '" + m_Arguments +
|
||||
"': PID " + Convert::ToString(pi.dwProcessId));
|
||||
"': PID " + Convert::ToString(m_PID));
|
||||
|
||||
#else /* _WIN32 */
|
||||
int fds[2];
|
||||
|
@ -514,8 +515,10 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
|
|||
|
||||
// parent process
|
||||
|
||||
m_PID = m_Process;
|
||||
|
||||
Log(LogInformation, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") +
|
||||
"': PID " + Convert::ToString(m_Process));
|
||||
"': PID " + Convert::ToString(m_PID));
|
||||
|
||||
m_Arguments.clear();
|
||||
|
||||
|
@ -636,9 +639,9 @@ bool Process::DoEvents(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
Process::ProcessHandle Process::GetHandle(void) const
|
||||
pid_t Process::GetPID(void) const
|
||||
{
|
||||
return m_Process;
|
||||
return m_PID;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
|
||||
void Run(const boost::function<void (const ProcessResult&)>& callback = boost::function<void (const ProcessResult&)>());
|
||||
|
||||
ProcessHandle GetHandle(void) const;
|
||||
pid_t GetPID(void) const;
|
||||
|
||||
static Arguments PrepareCommand(const Value& command);
|
||||
|
||||
|
@ -87,6 +87,7 @@ private:
|
|||
double m_Timeout;
|
||||
|
||||
ProcessHandle m_Process;
|
||||
pid_t m_PID;
|
||||
ConsoleHandle m_FD;
|
||||
|
||||
std::ostringstream m_OutputStream;
|
||||
|
|
Loading…
Reference in New Issue