From: Leo-Andres Hofmann Date: Sun, 8 May 2022 12:09:51 +0000 (+0200) Subject: pakfire.cgi: Discard tac stderr output X-Git-Tag: v2.27-core170~175 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3706e0a5b34f65baa7b6bfaad38ac6bd0496d50c;p=ipfire-2.x.git pakfire.cgi: Discard tac stderr output Prevents meaningless "broken pipe" messages in the httpd error log. Signed-off-by: Leo-Andres Hofmann Acked-by: Peter Müller --- 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;