aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc
diff options
context:
space:
mode:
authorAntranig Vartanian <antranigv@freebsd.am>2021-09-08 07:07:49 +0000
committerKyle Evans <kevans@FreeBSD.org>2021-09-10 05:30:04 +0000
commit7955efd574b98601a95da45d6d8e7f452631fddd (patch)
tree3a098e3fcb6939188774e7fba813180e7872c32e /libexec/rc
parent35aa1d6e4542ce7c8be127b85da2a5c9e8ade3f7 (diff)
downloadsrc-7955efd574b98601a95da45d6d8e7f452631fddd.tar.gz
src-7955efd574b98601a95da45d6d8e7f452631fddd.zip
Add support for jail.conf.d
Using /etc/jail.{jailname}.conf is nice, however it makes /etc/ very messy if you have many jails. This patch allows one to move these config files out of the way into /etc/jail.conf.d/{jailname}.conf. Note that the same caveat as /etc/jail.*.conf applies: the jail service will not autodiscover all of these for starting 'all' jails. This is considered future work, since the behavior matches. Reviewed by: kevans MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D24570
Diffstat (limited to 'libexec/rc')
-rwxr-xr-xlibexec/rc/rc.d/jail4
1 files changed, 4 insertions, 0 deletions
diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail
index ff4336131bc9..1d544501e32b 100755
--- a/libexec/rc/rc.d/jail
+++ b/libexec/rc/rc.d/jail
@@ -120,12 +120,16 @@ parse_options()
fi
eval _jconf=\"\${jail_${_jv}_conf:-/etc/jail.${_j}.conf}\"
eval _rootdir=\"\$jail_${_jv}_rootdir\"
+ eval _jconfdir=\"/etc/jail.conf.d/${_j}.conf\"
eval _hostname=\"\$jail_${_jv}_hostname\"
if [ -z "$_rootdir" -o \
-z "$_hostname" ]; then
if [ -r "$_jconf" ]; then
_conf="$_jconf"
return 0
+ elif [ -r "$_jconfdir" ]; then
+ _conf="$_jconfdir"
+ return 0
elif [ -r "$jail_conf" ]; then
_conf="$jail_conf"
return 0