mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 12:44:58 +02:00
parent
e0d4b9fb80
commit
541de0de78
@ -315,7 +315,7 @@ pid_t Application::StartReloadProcess(void)
|
|||||||
process->SetTimeout(300);
|
process->SetTimeout(300);
|
||||||
process->Run(&ReloadProcessCallback);
|
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_Process = pi.hProcess;
|
||||||
m_FD = outReadPipe;
|
m_FD = outReadPipe;
|
||||||
|
m_PID = pi.dwProcessId;
|
||||||
|
|
||||||
Log(LogInformation, "base", "Running command '" + m_Arguments +
|
Log(LogInformation, "base", "Running command '" + m_Arguments +
|
||||||
"': PID " + Convert::ToString(pi.dwProcessId));
|
"': PID " + Convert::ToString(m_PID));
|
||||||
|
|
||||||
#else /* _WIN32 */
|
#else /* _WIN32 */
|
||||||
int fds[2];
|
int fds[2];
|
||||||
@ -514,8 +515,10 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
|
|||||||
|
|
||||||
// parent process
|
// parent process
|
||||||
|
|
||||||
|
m_PID = m_Process;
|
||||||
|
|
||||||
Log(LogInformation, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") +
|
Log(LogInformation, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") +
|
||||||
"': PID " + Convert::ToString(m_Process));
|
"': PID " + Convert::ToString(m_PID));
|
||||||
|
|
||||||
m_Arguments.clear();
|
m_Arguments.clear();
|
||||||
|
|
||||||
@ -636,9 +639,9 @@ bool Process::DoEvents(void)
|
|||||||
return false;
|
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&)>());
|
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);
|
static Arguments PrepareCommand(const Value& command);
|
||||||
|
|
||||||
@ -87,6 +87,7 @@ private:
|
|||||||
double m_Timeout;
|
double m_Timeout;
|
||||||
|
|
||||||
ProcessHandle m_Process;
|
ProcessHandle m_Process;
|
||||||
|
pid_t m_PID;
|
||||||
ConsoleHandle m_FD;
|
ConsoleHandle m_FD;
|
||||||
|
|
||||||
std::ostringstream m_OutputStream;
|
std::ostringstream m_OutputStream;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user