]> granicus.if.org Git - icinga2/commitdiff
Revert "Fix external command pipe: Too many open files"
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 20 Aug 2014 11:32:07 +0000 (13:32 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 20 Aug 2014 11:32:07 +0000 (13:32 +0200)
This reverts commit 1a3f7d774c2dce7750103913b2864c3c588b386f.

components/compat/externalcommandlistener.cpp
tools/scripts/process_check_result

index fe25bc4c3f0969e1b9b45510ebb8321750f04497..64ec44dfad3f1bbaf31c75769b4f68ef96b80cd1 100644 (file)
@@ -111,7 +111,9 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
                                return;
                        }
 
-                       Log(LogDebug, "ExternalCommandListener", "Client connected");
+
+
+                       Log(LogNotice, "ExternalCommandListener", "Client connected");
                        Utility::QueueAsyncCallback(boost::bind(&ExternalCommandListener::ClientHandler, this, commandPath, fd));
                } catch (std::exception&) {
                        Log(LogCritical, "ExternalCommandListener", "Cannot accept new connection.");
@@ -142,19 +144,6 @@ void ExternalCommandListener::ClientHandler(const String& commandPath, int fd)
 
        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 {
                Log(LogInformation, "ExternalCommandListener", "Executing external command: " + command);
 
@@ -163,6 +152,7 @@ void ExternalCommandListener::ClientHandler(const String& commandPath, int fd)
                std::ostringstream msgbuf;
                msgbuf << "External command failed.";
                Log(LogWarning, "ExternalCommandListener", msgbuf.str());
+               return;
        }
 
        delete line;
index c329c05546411e0f729b0a0c9fcd99930f05c18e..6d01ace0c1dfb987a3b63c52e15eb9cb4690e5ed 100755 (executable)
@@ -89,6 +89,6 @@ else
 fi
 
 echo "Sending '$ECHO $CMDLINE >> $CMDFILE'"
-`$ECHO "$CMDLINE" >> $CMDFILE`
+`$ECHO $CMDLINE >> $CMDFILE`
 
 exit 0