Page MenuHomeFreeBSD

(WIP) rc: Allow environment to override sourced rc.conf
Needs ReviewPublic

Authored by kevans on Jan 17 2018, 3:29 AM.
Tags
Referenced Files
F82145390: D13946.diff
Thu, Apr 25, 10:31 PM
Unknown Object (File)
Feb 3 2024, 7:08 AM
Unknown Object (File)
Dec 23 2023, 2:06 AM
Unknown Object (File)
Dec 22 2023, 2:42 AM
Unknown Object (File)
Nov 23 2023, 5:47 AM
Unknown Object (File)
Nov 18 2023, 4:52 AM
Unknown Object (File)
Oct 30 2023, 6:42 PM
Unknown Object (File)
Sep 7 2023, 12:39 PM
Subscribers

Details

Reviewers
jilles
dteske
Summary

This is the idea I've got in the back of my mind to allow for easier testing of service(8), maybe sysrc(8) if that makes sense as well.

Allow override of local rc.conf with an environment variable, in similar fashion to __MAKE_CONF: __RC_CONF. This allows the environment to override the sourcing of /etc/rc.conf and /etc/rc.conf.local for reasonable testing of service(8). An example test being able to create an rc.conf that overrides local_startup and/or other rc vars so that it can reasonably test without worrying about an installed port breaking things.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 14428

Event Timeline

I understand the double-underbar prefix as an analog to __MAKE_CONF but right above __RC_CONF is RC_PID; could we make it RC_CONF to be more internally consistent within the given file?

I understand the double-underbar prefix as an analog to MAKE_CONF but right above RC_CONF is RC_PID; could we make it RC_CONF to be more internally consistent within the given file?

Sure- I'm not set on any of it, to be honest- I figured the double-underbar prefix would also make it harder to accidentally set, but I suppose RC_CONF is already not something likely to be accidentally set. ;)

Do you have any opinions on this as a mechanism in general? It'd be nice if we could test service(8) and some friends within our normal test framework without imposing jails as a requirement, but I can see where one might prefer such tests to be jail-based. The problem is that I *think* jail-based tests, though eventually necessary, are going to be pretty heavy from a testing perspective.

0mp added a subscriber: 0mp.