# Where is official documentation for "jail.conf"?



## ikevin8me (Aug 25, 2017)

Since the several past releases, we had been been getting this message:


```
/etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables  is obsolete.  Please consider migrating to /etc/jail.conf.
```

I had been keeping watch on the jails documentation for a few years and still couldn't see any mentioning of "jail.conf". Will the documentation be updated soon?

Thanks!


----------



## SirDice (Aug 25, 2017)

jail.conf(5).


----------



## ikevin8me (Aug 25, 2017)

Ummm... I saw this documentation before. It is too brief. I don't want to spend too much doing trial and error to get it to work. Let's hope the official documenation ("Handbook") will be updated soon.


----------



## SirDice (Aug 25, 2017)

Not much to it actually, it simply uses the options from jail(8). There's an example jail.conf at the end of jail(8):


```
Create an entry for the jail in
     /etc/jail.conf:

           testjail {
                   path = /tmp/jail/testjail;
                   mount.devfs;
                   host.hostname = testhostname;
                   ip4.addr = 192.0.2.100;
                   interface = ed0;
                   exec.start = "/bin/sh /etc/rc";
                   exec.stop = "/bin/sh /etc/rc.shutdown";
           }
```

Each of the settings in jail.conf refers to an option of the same name from jail(8).


----------



## ikevin8me (Aug 25, 2017)

That doesn't look difficult.

So, the existence of the file itself will cause the jail to be started automatically? There is no need to include a reference from the rc.conf file like 'jail_list="testjail"'?


----------



## SirDice (Aug 25, 2017)

You'll need these:

```
jail_enable="YES"
jail_list="myjail1 myjail2"
```
You can define more jails in jail.conf but only the ones listed in jail_list will get started at boot.


----------



## krawall (Aug 28, 2017)

But of course you don't need the `jail_list=".."` var. Just having `jail_enable="YES"` in your rc.conf will start every jail configured in jail.conf


----------



## SirDice (Aug 28, 2017)

krawall said:


> But of course you don't need the  jail_list=".." var. Just having  jail_enable="YES" in your rc.conf will start every jail configured in jail.conf


It defaults to _ALL when jail_list isn't defined. Note that jail_list="" is not the same as not defining it. 


```
1)      run_rc_command $@ ${jail_list:-_ALL} ;;
```


----------

