mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-22 17:02:58 +02:00
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:
committed by
Peter Müller
parent
85d570843e
commit
3706e0a5b3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user