Page MenuHomeFreeBSD

periodic: set _localbase in periodic scripts when not set in main script
ClosedPublic

Authored by otis on Nov 8 2024, 1:41 PM.
Tags
None
Referenced Files
F151854432: D47486.id.diff
Sat, Apr 11, 3:10 AM
Unknown Object (File)
Thu, Apr 9, 11:52 PM
Unknown Object (File)
Sun, Apr 5, 11:34 PM
Unknown Object (File)
Sun, Apr 5, 4:00 AM
Unknown Object (File)
Sat, Apr 4, 5:57 AM
Unknown Object (File)
Fri, Apr 3, 6:08 PM
Unknown Object (File)
Fri, Apr 3, 2:48 AM
Unknown Object (File)
Thu, Apr 2, 6:24 PM

Diff Detail

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

Event Timeline

otis requested review of this revision.Nov 8 2024, 1:41 PM
otis created this revision.
This revision is now accepted and ready to land.Nov 11 2024, 9:45 AM

Works for me!

However, this addition essentially is a duplication of the _localbase logic already present in /usr/sbin/periodic, which is (a) taking _localbase from sysctl and (b) providing a fall-back default just in case. As periodic(8), in some sense, implements a scripting facility similar to rc(8), my feeling is that it's more adequate to implement it along rc(8)'s lines, which is (a) setting _localbase from the sysctl in the main script /etc/rc, and (b) supplying a default for _localbase in /etc/defaults/rc.conf as fallback. Admittedly that's a bit of nitpicking to some extent.

Set _localbase earlier from within /etc/defaults/periodic.conf

This revision now requires review to proceed.Dec 4 2024, 8:40 PM
markj added a subscriber: markj.
markj added inline comments.
usr.sbin/periodic/periodic.conf
18

I'd prefix this with an underscore so that it's less likely to collide with some user-added identifiers.

420

Unrelated whitespace change.

This revision is now accepted and ready to land.Jan 17 2025, 6:16 PM