pakfire.cgi: Discard tac stderr output

Prevents meaningless "broken pipe" messages in the httpd error log.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
This commit is contained in:
Leo-Andres Hofmann
2022-05-08 14:09:51 +02:00
committed by Peter Müller
parent 85d570843e
commit 3706e0a5b3

View File

@@ -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;