From 3706e0a5b34f65baa7b6bfaad38ac6bd0496d50c Mon Sep 17 00:00:00 2001 From: Leo-Andres Hofmann Date: Sun, 8 May 2022 14:09:51 +0200 Subject: [PATCH] pakfire.cgi: Discard tac stderr output MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Prevents meaningless "broken pipe" messages in the httpd error log. Signed-off-by: Leo-Andres Hofmann Acked-by: Peter Müller --- html/cgi-bin/pakfire.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 6fade81bd1..489b07a6d5 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -75,7 +75,7 @@ if($cgiparams{'ACTION'} eq 'json-getstatus') { # Read /var/log/messages backwards until a "Pakfire started" header is found, # to capture all messages of the last (i.e. current) Pakfire run - my @messages = `tac /var/log/messages | sed -n '/pakfire:/{p;/Pakfire.*started/q}'`; + my @messages = `tac /var/log/messages 2>/dev/null | sed -n '/pakfire:/{p;/Pakfire.*started/q}'`; # Test if the log contains an error message (fastest implementation, stops at first match) my $failure = any{ index($_, 'ERROR') != -1 } @messages; -- 2.39.2