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)
May 4 2024, 3:01 PM
Unknown Object (File)
Apr 26 2024, 2:55 AM
Unknown Object (File)
Apr 14 2024, 8:42 AM
Unknown Object (File)
Apr 5 2024, 7:21 PM
Unknown Object (File)
Feb 23 2024, 8:32 AM
Unknown Object (File)
Feb 16 2024, 9:39 PM
Unknown Object (File)
Jan 11 2024, 6:14 PM
Unknown Object (File)
Jan 10 2024, 12:13 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