mirror of https://github.com/Icinga/icinga2.git
Output child pid to debug log when forking.
Fixes #5756 Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
This commit is contained in:
parent
737675387d
commit
40b88422d2
|
@ -184,8 +184,6 @@ void Process::Run(const boost::function<void (const ProcessResult&)>& callback)
|
||||||
#endif /* HAVE_PIPE2 */
|
#endif /* HAVE_PIPE2 */
|
||||||
|
|
||||||
// build argv
|
// build argv
|
||||||
Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") + "'.");
|
|
||||||
|
|
||||||
char **argv = new char *[m_Arguments.size() + 1];
|
char **argv = new char *[m_Arguments.size() + 1];
|
||||||
|
|
||||||
for (unsigned int i = 0; i < m_Arguments.size(); i++)
|
for (unsigned int i = 0; i < m_Arguments.size(); i++)
|
||||||
|
@ -193,8 +191,6 @@ void Process::Run(const boost::function<void (const ProcessResult&)>& callback)
|
||||||
|
|
||||||
argv[m_Arguments.size()] = NULL;
|
argv[m_Arguments.size()] = NULL;
|
||||||
|
|
||||||
m_Arguments.clear();
|
|
||||||
|
|
||||||
// build envp
|
// build envp
|
||||||
int envc = 0;
|
int envc = 0;
|
||||||
|
|
||||||
|
@ -262,6 +258,11 @@ void Process::Run(const boost::function<void (const ProcessResult&)>& callback)
|
||||||
|
|
||||||
// parent process
|
// parent process
|
||||||
|
|
||||||
|
Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") +
|
||||||
|
"': PID " + Convert::ToString(m_Pid));
|
||||||
|
|
||||||
|
m_Arguments.clear();
|
||||||
|
|
||||||
// free arguments
|
// free arguments
|
||||||
for (int i = 0; argv[i] != NULL; i++)
|
for (int i = 0; argv[i] != NULL; i++)
|
||||||
free(argv[i]);
|
free(argv[i]);
|
||||||
|
|
Loading…
Reference in New Issue