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)
Fri, Nov 15, 8:14 PM
Unknown Object (File)
Thu, Nov 14, 8:14 AM
Unknown Object (File)
Thu, Nov 14, 7:33 AM
Unknown Object (File)
Wed, Nov 13, 10:27 PM
Unknown Object (File)
Wed, Nov 13, 8:26 PM
Unknown Object (File)
Mon, Nov 11, 5:49 PM
Unknown Object (File)
Mon, Nov 11, 4:40 PM
Unknown Object (File)
Mon, Nov 11, 3:06 PM
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