# A better understanding of ezjail



## pathiaki (Jul 19, 2013)

Hi,

I'm seldom confused but I have some serious questions about ezjail. I like it quite a bit but I'm trying to figure out flavours, basejail, newjail, etc.

I'm on FreeBSD 9.1.  I'm using ezjail 3.3. (Is there something wrong with the port not installing the man pages? - I'll send e-mail on that to ports soon.) I'm on ZFS which works wonderfully with ezjail.  I'm trying to automate the creation of about ten jails.  I have manage to hack a script to do most of this and they come up and run but specific configurations are missing. My jails directory is /jails (and I've modified /usr/local/etc/ezjail.conf correctly, I believe. My questions involve execution and proper file location...

First, the subject of newjail:

Is my understanding of newjail correct in that everything in there is copied to every new jail that is created?  That is, is this where I would put common files that are necessary for all my jails? For example: /etc/nsswitch.conf, /etc/resolv.conf, /etc/make.conf?

Next, I'm a little confused about flavours.  My understanding is that I can make sure that additional, jail-specific, files can be installed by using this method.  Most importantly, /etc/rc.conf as this is the default of where all the software startup and the jail identity is configured.

I also have bundle of packages (like Perl) that need to be installed in all the jails.  I believe the location given my jail home directory of /jails to /jails/flavours/minimaljail/pkg for these packages. (I use 'minimaljail' instead of 'example' and I've modified the default flavour to use in /usr/local/etc/ezjail.conf to reflect this.  However, is 'minimaljail' enough of a description in that field?) Is this correct?

In the directory /jails/flavours/minimaljail/etc/rc.d, I have a file ezjail.flavour (copied from the ezjail.flavour file) where I just modified things to go to a package directory I installed and perform a `pkg add *`.

I also have jail-specific flavours for a web server and a DNS server. I have similar files in /jails/flavours/{web,dns}/etc/rc.d/ezjail.flavour. Is that file named correctly or should it be /jails/flavours/web/etc/rc.d/web.flavour?

When I do an `ezjail-admin create -f <some flavor> <name> <IP>`, does this perform `ezjail-admin create -f minimaljail -f <some flavor> <name>`?

I ask as the default "minimaljail" is in the ezjail.conf file and I would also like to add jail specific packages and the /etc/rc.conf file along with the minimal packages from the minimaljail flavour.  Is this possible?

Last (I hope), I would like to use PKGNG on all my jails.  Is this possible at this point? If so, how would I go about doing it at configuration time as I have a multi-faceted bit of confusion here?

Thank you all,

P


----------

