jails Jails defined in /etc/jail.conf.d/*.conf don't pick up default path from /etc/jail.conf

I'm setting a default path in /etc/jail.conf:

Code:
jimsdesk : 13:21:21 /etc# cat jail.conf
# The general syntax of a jail definition is:
#
#   jailname {
#       parameter = "value";
#       parameter = "value";
#       ...
#   }


# Jail defaults:
 
## startup/logging
exec.start      = "/bin/sh /etc/rc";
exec.stop       = "/bin/sh /etc/rc.shutdown";
exec.consolelog     = "/var/log/jail_${name}.log";

host.hostname       = "${name}";
path            = "/jail/${name}";


#linux.osname       = 'FreeBSD';    # default


# Jail definitions are now in /etc/jail.conf.d/*.conf

#.include "/etc/jail.conf.d/*.conf";

.include jail.conf.d/aarch64.conf
.include jail.conf.d/mailman2.conf
.include jail.conf.d/webwork2.conf

Three jails are configured to start:

Code:
jimsdesk : 13:21:24 /etc# j=$(sysrc -n jail_list); echo $j
webwork2 mailman2 aarch64

None of their conf files override the "path" variable:

Code:
jimsdesk : 13:21:29 /etc# for j in $j; do egrep -H '^[[:blank:]]*path[[:blank:]]*=' jail.conf.d/$j.conf; done

Yet when they start, none of the jails picks up the correct path:

Code:
jimsdesk : 13:21:39 /etc# jls
   JID  IP Address      Hostname                      Path
jimsdesk : 13:21:40 /etc# service jail start
Starting jails: webwork2 mailman2 aarch64.
jimsdesk : 13:21:44 /etc# jls
   JID  IP Address      Hostname                      Path
    23  192.168.1.5     webwork2.example.edu          /
    24  192.168.1.7     listhost.example.edu          /
    25  192.168.1.95    aarch64.example.edu           /

A typical jail.conf file is:

Code:
aarch64 {
persist;
host.hostname = "aarch64.example.edu";
ip4.addr = "private|192.168.1.95/32";
allow.raw_sockets = 1;
allow.chflags = 1;
}

This didn't used to happen, but I can't put a finger on just when it might
have started, as I don't frequently restart jails.

OS is FreeBSD 14.3-RELEASE releng/14.3-n271432-8c9ce319fef7 GENERIC.

Thanks as always for any pointers.


Jim
 
Put your defaults under "*" section:
Code:
"*" {
# Jail defaults:
 
## startup/logging
exec.start      = "/bin/sh /etc/rc";
exec.stop       = "/bin/sh /etc/rc.shutdown";
exec.consolelog     = "/var/log/jail_${name}.log";

host.hostname       = "${name}";
path            = "/jail/${name}";
}
 
Back
Top