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
This commit is contained in:
parent
35aa1d6e45
commit
7955efd574
@ -56,6 +56,8 @@
|
|||||||
..
|
..
|
||||||
gss
|
gss
|
||||||
..
|
..
|
||||||
|
jail.conf.d
|
||||||
|
..
|
||||||
kyua tags=package=tests
|
kyua tags=package=tests
|
||||||
..
|
..
|
||||||
mail
|
mail
|
||||||
|
@ -120,12 +120,16 @@ parse_options()
|
|||||||
fi
|
fi
|
||||||
eval _jconf=\"\${jail_${_jv}_conf:-/etc/jail.${_j}.conf}\"
|
eval _jconf=\"\${jail_${_jv}_conf:-/etc/jail.${_j}.conf}\"
|
||||||
eval _rootdir=\"\$jail_${_jv}_rootdir\"
|
eval _rootdir=\"\$jail_${_jv}_rootdir\"
|
||||||
|
eval _jconfdir=\"/etc/jail.conf.d/${_j}.conf\"
|
||||||
eval _hostname=\"\$jail_${_jv}_hostname\"
|
eval _hostname=\"\$jail_${_jv}_hostname\"
|
||||||
if [ -z "$_rootdir" -o \
|
if [ -z "$_rootdir" -o \
|
||||||
-z "$_hostname" ]; then
|
-z "$_hostname" ]; then
|
||||||
if [ -r "$_jconf" ]; then
|
if [ -r "$_jconf" ]; then
|
||||||
_conf="$_jconf"
|
_conf="$_jconf"
|
||||||
return 0
|
return 0
|
||||||
|
elif [ -r "$_jconfdir" ]; then
|
||||||
|
_conf="$_jconfdir"
|
||||||
|
return 0
|
||||||
elif [ -r "$jail_conf" ]; then
|
elif [ -r "$jail_conf" ]; then
|
||||||
_conf="$jail_conf"
|
_conf="$jail_conf"
|
||||||
return 0
|
return 0
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd July 8, 2021
|
.Dd September 10, 2021
|
||||||
.Dt RC.CONF 5
|
.Dt RC.CONF 5
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -3883,6 +3883,13 @@ The configuration filename used by
|
|||||||
utility.
|
utility.
|
||||||
The default value is
|
The default value is
|
||||||
.Pa /etc/jail.conf .
|
.Pa /etc/jail.conf .
|
||||||
|
.Pa /etc/jail. Ns Ao Ar jname Ac Ns Va .conf
|
||||||
|
and
|
||||||
|
.Pa /etc/jail.conf.d/ Ns Ao Ar jname Ac Ns Va .conf
|
||||||
|
will also be used if
|
||||||
|
.Va Ao Ar jname Ac Va
|
||||||
|
is set in
|
||||||
|
.Va jail_list .
|
||||||
.It Va jail_parallel_start
|
.It Va jail_parallel_start
|
||||||
.Pq Vt bool
|
.Pq Vt bool
|
||||||
If set to
|
If set to
|
||||||
|
Loading…
Reference in New Issue
Block a user