Solved FreeBSD10 + ezjail = consider to migrate to /etc/jail.conf

I did a fresh install of FreeBSD 10 as upgrade process from 9.2 has failed for me. Almost everything went smooth except jails. I have recreated new jails on new OS and I am getting such problem:

Code:
root@dedi10:/usr/jails # ezjail-admin create etest4 10.0.0.4
.....
root@dedi10:/etc # ezjail-admin start etest4
Starting jails:/etc/rc.d/jail: WARNING: /var/run/jail.etest4.conf is created and used for jail etest4.
etest4.
/etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables  is obsolete.  Please consider to migrate to /etc/jail.conf.

Code:
root@dedi10:/etc # jls
   JID  IP Address      Hostname                      Path
     1  10.0.0.4        etest4                        /usr/jails/etest4

Code:
root@dedi10:/etc # cat /etc/jail.conf
exec.start += "sleep  2 ";
allow.raw_sockets = 1;
exec.clean;
exec.system_user = "root";
exec.jail_user = "root";
exec.start += "/bin/sh /etc/rc";
exec.stop = "";
exec.consolelog = "/var/log/jail_$name_console1.log";
path = "/usr/jails/$name";
mount.devfs;
mount.fstab = "/etc/fstab.$name";
mount.fdescfs;
mount +=  "procfs /usr/jails/$name/proc procfs rw 0 0";
allow.mount;
allow.set_hostname = 1;
allow.sysvipc = 0;


etest4 {
    host.hostname = "etest4";
    ip4.addr += "10.0.0.2/32";

}

ezhosting {
    host.hostname = "ezhosting";
    ip4.addr += "10.0.0.1/32";

}

Code:
root@dedi10:/etc # uname -a
FreeBSD dedi10 10.0-RELEASE-p9 FreeBSD 10.0-RELEASE-p9 #0: Mon Sep 15 14:35:52 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

Code:
root@dedi10:~ # cat /usr/local/etc/ezjail/etest4
# To specify the start up order of your ezjails, use these lines to
# create a Jail dependency tree. See rcorder(8) for more details.
#
# PROVIDE: standard_ezjail
# REQUIRE:
# BEFORE:
#

export jail_etest4_hostname="etest4"
export jail_etest4_ip="10.0.0.4"
export jail_etest4_rootdir="/usr/jails/etest4"
export jail_etest4_exec_start="/bin/sh /etc/rc"
export jail_etest4_exec_stop=""
export jail_etest4_mount_enable="YES"
export jail_etest4_devfs_enable="YES"
export jail_etest4_devfs_ruleset="devfsrules_jail"
export jail_etest4_procfs_enable="YES"
export jail_etest4_fdescfs_enable="YES"
export jail_etest4_image=""
export jail_etest4_imagetype="zfs"
export jail_etest4_attachparams=""
export jail_etest4_attachblocking=""
export jail_etest4_forceblocking=""
export jail_etest4_zfs_datasets=""
export jail_etest4_cpuset=""
export jail_etest4_fib=""
export jail_etest4_parentzfs="zroot/usr/jails"
export jail_etest4_parameters=""
export jail_etest4_post_start_script=""
export jail_etest4_retention_policy=""

Code:
root@dedi10:~ # cat /var/run/jail.etest4.conf
# Generated by rc.d/jail at 2014-09-20 10:58:42
etest4 {
        host.hostname = "etest4";
        path = "/usr/jails/etest4";
        ip4.addr += "10.0.0.4/32";
        allow.raw_sockets = 0;
        exec.clean;
        exec.system_user = "root";
        exec.jail_user = "root";
        exec.start += "/bin/sh /etc/rc";
        exec.stop = "";
        exec.consolelog = "/var/log/jail_etest4_console.log";
        mount.devfs;
        mount.fstab = "/etc/fstab.etest4";
        mount.fdescfs;
        mount +=  "procfs /usr/jails/etest4/proc procfs rw 0 0";
        allow.mount;
        allow.set_hostname = 0;
        allow.sysvipc = 0;
}

rc.conf has only ezjail_enable="YES".


Anyone could help to find why /etc/jail.conf is not used?
 
Re: FreeBSD10 + ezjail = consider to migrate to /etc/jail.co

I would imagine its because you are using ezjail to start the jail, which thus uses it's own config files for that purpose. I'd suggest either using one or the other not both.
Code:
# service ezjail stop
# service jail etest4 onestart
should get it to read the /etc/jail.conf, so if that works then add
Code:
jail_enable=yes
and remove the
Code:
ezjail_enable=yes
option and you could start the service normally
When you are starting ezjail the first warning is probably caused by it finding the file it refers to when it tries to create the same file, and the second is only a warning about the variables being obsolete (but they do still work) and it is running fine.
 
Re: FreeBSD10 + ezjail = consider to migrate to /etc/jail.co

The sysutils/ezjail port just happens to use the old style of configuration for jails. The config files are in /usr/local/etc/ezjail/ in the rc.conf style of configuring jails. They get converted on the fly into the new form when the jail starts. Until the port gets updated to deal with the old and new styles in some form the configuration will have to be converted each time.
 
Back
Top