Page MenuHomeFreeBSD

Fix periodic reports when log files are not compressed.
ClosedPublic

Authored by nyan on Jan 8 2024, 11:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 8, 2:09 PM
Unknown Object (File)
Thu, Nov 28, 11:35 PM
Unknown Object (File)
Thu, Nov 28, 2:31 AM
Unknown Object (File)
Nov 21 2024, 6:46 AM
Unknown Object (File)
Nov 6 2024, 2:12 PM
Unknown Object (File)
Oct 27 2024, 6:13 PM
Unknown Object (File)
Oct 2 2024, 5:48 PM
Unknown Object (File)
Oct 2 2024, 5:34 AM
Subscribers

Details

Summary

periodic: Fix periodic reports when log files are not compressed.

The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.

PR: 253168

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

nyan requested review of this revision.Jan 8 2024, 11:02 AM

This is fine...
But maybe that function needs to be in a central location?
rc.subr seems the only place that might be accessible because periodic doesn't have a set of common routines, though there's a few in periodic.conf
Moving catmsgs likely should be considered, but might be out of scope for such a simple fix.

This revision is now accepted and ready to land.Jan 8 2024, 5:16 PM
delphij requested changes to this revision.Jan 9 2024, 7:14 AM

I don't think these whole case..esac blocks are needed: modern enough zcat(1) is capable of handling compressed and uncompressed text files, so you can simply do:

	    do
		zcat -f $f
	    done

and done with it...

In D43357#988243, @imp wrote:

This is fine...
But maybe that function needs to be in a central location?

This is already implemented in zcat(1) :)

This revision now requires changes to proceed.Jan 9 2024, 7:14 AM
nyan edited the summary of this revision. (Show Details)

delphij: Thanks you for your comment. I've updated my patch.

LGTM. Do we want to extract that catmsgs out to somewhere? (Not necessarily as part of this commit)

This revision is now accepted and ready to land.Jan 9 2024, 9:04 PM