# /etc/jails.conf useless after 12.0 > 12.1



## dns.company (Mar 5, 2020)

Past week I've upgraded 25 servers from 12.0 to 12.1, all fine.
Today I did another 6, but now suddenly `/etc/rc.d/jail onestart` doesn't work for me, since /etc/jail.conf is not being read anymore, as in /etc/rc.conf the default: 
	
	



```
jail_config="/etc/jail.conf"
```
 was removed.
I remember seeing that being suggested in a patch, but didn't expect this -without warning- being removed.
Although during upgrade the diffs already showed my problem ahead.

Since FreeBSD 9 or 10 or maybe even earlier I see warnings I should NOT put it in /etc/rc.conf but /etc/jail.conf,
an advice I followed; I made I made a nice separate config, providing me a clear overview of the many IP's I use.
...which now is pointless?

As solution I noticed doing the opposite of the warning -the warning which is also removed- seems to work.
But is there a way to keep /etc/jail.conf the location of my jail config?

One positive side is, that I still have a few servers on which I didn't follow the "important advice" (...).


----------



## SirDice (Mar 5, 2020)

dns.company said:


> now suddenly `/etc/rc.d/jail onestart` doesn't work for me, since /etc/jail.conf is not being read anymore, as in /etc/rc.conf the default
> `jail_config="/etc/jail.conf"` was removed.



It's `jail_conf` and it's still there:


```
% grep jail_conf /etc/defaults/rc.conf
jail_conf="/etc/jail.conf"      # Configuration file for jail(8)
jail_confwarn="YES"     # Prevent warning about obsolete per-jail configuration
% freebsd-version -u
12.1-RELEASE-p2
```


```
# grep jail_conf /etc/defaults/rc.conf
jail_conf="/etc/jail.conf"      # Configuration file for jail(8)
jail_confwarn="YES"     # Prevent warning about obsolete per-jail configuration
# freebsd-version -u
12.1-STABLE
# jls
   JID  IP Address      Hostname                      Path
     1  192.168.10.202  j-ports.dicelan.home          /jails/j-ports
```


----------



## dns.company (Mar 5, 2020)

The only jail related contents in my /etc/defaults/rc.conf is

```
##############################################################
### Jail Configuration (see rc.conf(5) manual page) ##########
##############################################################
jail_enable="NO"        # Set to NO to disable starting of any jails
jail_parallel_start="NO"        # Start jails in the background
jail_list=""            # Space separated list of names of jails
jail_reverse_stop="NO"  # Stop jails in reverse order
```
So I've added your lines

```
jail_conf="/etc/jail.conf"      # Configuration file for jail(8)
jail_confwarn="YES"     # Prevent warning about obsolete per-jail configuration
```
And then it will start.
It took the values which I -in panic- added to /etc/rc.conf:
`loc.x# /etc/rc.d/jail onestart virt1
Starting jails:/etc/rc.d/jail: WARNING: /var/run/jail.virt1.conf is created and used for jail virt1.
 loc.x.virt1.domain.tld.
/etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables  is obsolete.  Please consider migrating to /etc/jail.conf.`
When I remove what I've added to /etc/rc.conf then it's all working fine as before.

Question that now rised: how come these lines suddenly were missing?
During upgrading I've used `freebsd-update upgrade -r 12.1-RELEASE` (double checked in my history).
But it looks like I've received something else ...?


----------



## SirDice (Mar 5, 2020)

Have you ever edited /etc/defaults/rc.conf? That may have caused merge failures during the upgrade.


----------



## dns.company (Mar 5, 2020)

SirDice said:


> Have you ever edited /etc/defaults/rc.conf? That may have caused merge failures during the upgrade.


After your post; yes. But before; no never!
However, during last `freebsd-update` I noticed these two lines showing up in the diff dialog phase
(at that point I didn't expect any serious trouble, and didn't take notice in which file exactly this was)
Earlier I've for sure saw a proposed but not (yet) commited patch (somewhere here at freebsd.org); suggesting these lines being removed in the future.
Makes me wonder if I maybe might have received STABLE while asking for RELEASE.
(after completing `freebsd-update` exactly as described in the manual, I made a custom kernel, so -I guess- it's hard to trace back).
Also; I did the same 12.0 > 12.1 upgrade on many other machines earlier this week - all without this problem.


----------



## SirDice (Mar 6, 2020)

dns.company said:


> However, during last `freebsd-update` I noticed these two lines showing up in the diff dialog phase
> (at that point I didn't expect any serious trouble, and didn't take notice in which file exactly this was)


That's actually strange. These variables have been around since jail.conf was added (in 9.1 according to the man page). 



dns.company said:


> Makes me wonder if I maybe might have received STABLE while asking for RELEASE.


That would be impossible if you used freebsd-update(8), it only works with -RELEASE versions. Besides that, -STABLE still includes them. And as far as I know jail.conf isn't going anywhere. 

What may happen some time in the near future is that the support for those jail_* variables in rc.conf will disappear, i.e. the "old" way of configuring jails. These variables still work but give a "deprecation" warning.


----------

