Page MenuHomeDevCentral

Check if /etc/os-release is up-to-date on FreeBSD
ClosedPublic

Authored by dereckson on Aug 10 2024, 11:39.
Tags
None
Referenced Files
F11424176: D3416.id8813.diff
Tue, Aug 26, 15:55
F11416547: D3416.id.diff
Tue, Aug 26, 04:46
Unknown Object (File)
Wed, Aug 20, 08:53
Unknown Object (File)
Wed, Aug 20, 05:01
Unknown Object (File)
Tue, Aug 19, 07:39
Unknown Object (File)
Mon, Aug 18, 21:24
Unknown Object (File)
Fri, Aug 15, 05:39
Unknown Object (File)
Wed, Aug 13, 15:45
Subscribers
None

Details

Summary

Normally, /etc/os-release should be regenerated at boot time.
If we don't boot after a userland update, the file won't be updated either.

Raise a warning if the file is not up-to-date, a critical error if it doesn't exist.

Ref T2007.

Test Plan

Tested on WindRiver

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
check-os-release
Build Status
Buildable 5439
Build 5720: arc lint + arc unit

Event Timeline

dereckson created this revision.
dereckson edited the summary of this revision. (Show Details)
aceppaluni requested changes to this revision.EditedAug 12 2024, 01:08

Hi,
Should the shellcheck suggestion be added? I was not certain, If not, the code looks good :)

This revision now requires changes to proceed.Aug 12 2024, 01:08

The -x option allows shellcheck to source the external files (here /var/run/os-release), so it can know $VERSION exists for example:

$ shellcheck -x roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-os-release.sh

$ echo $?
0

Created T2010 to follow-up this shellcheck -x idea.

This revision is now accepted and ready to land.Aug 21 2024, 02:03