]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
pakfire.cgi: Discard tac stderr output
authorLeo-Andres Hofmann <hofmann@leo-andres.de>
Sun, 8 May 2022 12:09:51 +0000 (14:09 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Sun, 8 May 2022 13:13:21 +0000 (13:13 +0000)
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>
html/cgi-bin/pakfire.cgi

index 6fade81bd1f6b36033596990f73322bf98fe037b..489b07a6d58968f71844a5c2e5f0714d3f244a50 100644 (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;