mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 00:24:23 +02:00
Revert "Fix external command pipe: Too many open files"
This reverts commit 1a3f7d774c2dce7750103913b2864c3c588b386f.
This commit is contained in:
parent
495bc5b733
commit
f6a7f84ed5
@ -111,7 +111,9 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogDebug, "ExternalCommandListener", "Client connected");
|
|
||||||
|
|
||||||
|
Log(LogNotice, "ExternalCommandListener", "Client connected");
|
||||||
Utility::QueueAsyncCallback(boost::bind(&ExternalCommandListener::ClientHandler, this, commandPath, fd));
|
Utility::QueueAsyncCallback(boost::bind(&ExternalCommandListener::ClientHandler, this, commandPath, fd));
|
||||||
} catch (std::exception&) {
|
} catch (std::exception&) {
|
||||||
Log(LogCritical, "ExternalCommandListener", "Cannot accept new connection.");
|
Log(LogCritical, "ExternalCommandListener", "Cannot accept new connection.");
|
||||||
@ -142,19 +144,6 @@ void ExternalCommandListener::ClientHandler(const String& commandPath, int fd)
|
|||||||
|
|
||||||
String command = line;
|
String command = line;
|
||||||
|
|
||||||
if (command.IsEmpty()) {
|
|
||||||
fclose(fp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check if line contains [$unixts] */
|
|
||||||
if (line[0] != '[' || line[11] != ']') {
|
|
||||||
Log(LogDebug, "ExternalCommandListener", "Cannot find timestamp prefix in external command '" + command + "'. Bailing out.");
|
|
||||||
delete line;
|
|
||||||
fclose(fp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Log(LogInformation, "ExternalCommandListener", "Executing external command: " + command);
|
Log(LogInformation, "ExternalCommandListener", "Executing external command: " + command);
|
||||||
|
|
||||||
@ -163,6 +152,7 @@ void ExternalCommandListener::ClientHandler(const String& commandPath, int fd)
|
|||||||
std::ostringstream msgbuf;
|
std::ostringstream msgbuf;
|
||||||
msgbuf << "External command failed.";
|
msgbuf << "External command failed.";
|
||||||
Log(LogWarning, "ExternalCommandListener", msgbuf.str());
|
Log(LogWarning, "ExternalCommandListener", msgbuf.str());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete line;
|
delete line;
|
||||||
|
@ -89,6 +89,6 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Sending '$ECHO $CMDLINE >> $CMDFILE'"
|
echo "Sending '$ECHO $CMDLINE >> $CMDFILE'"
|
||||||
`$ECHO "$CMDLINE" >> $CMDFILE`
|
`$ECHO $CMDLINE >> $CMDFILE`
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user