# jail devfs.rules not loaded at boot



## da1 (Aug 30, 2010)

Hello fellas,

I have a 8.0-RELEASE, i386 box with 2 jails.

Here is my rc.conf:

```
jail_enable="YES"                                       # Set to NO to disable starting of any jails
jail_list="dns www"                                             # Space separated list of names of jails

jail_dns_rootdir="/jails/dns"                           # jail's root directory
jail_dns_hostname="dns"                                 # jail's hostname
jail_dns_ip="192.168.0.254"                             # jail's IP address
jail_dns_devfs_enable="YES"                             # mount devfs in the jail
jail_dns_devfs_ruleset="dns_ruleset"                    # devfs ruleset to apply to jail
jail_dns_exec_start="/bin/sh /etc/rc"                   # command to execute in jail for starting
jail_dns_exec_stop="/bin/sh /etc/rc.shutdown"           # command to execute in jail for stopping

jail_www_rootdir="/jails/www"                           # jail's root directory
jail_www_hostname="www"                                 # jail's hostname
jail_www_ip="192.168.0.253"                             # jail's IP address
jail_www_devfs_enable="YES"                             # mount devfs in the jail
jail_www_devfs_ruleset="www_ruleset"                    # devfs ruleset to apply to jail
jail_www_exec_start="/bin/sh /etc/rc"                   # command to execute in jail for starting
jail_www_exec_stop="/bin/sh /etc/rc.shutdown"           # command to execute in jail for stopping
```

/etc/devfs.rules:
	
	



```
[www_ruleset=1]
add hide
add path null unhide
add path zero unhide
add path random unhide
add path urandom unhide
add path crypto unhide
add path stdin unhide
add path stdout unhide
add path stderr unhide

[dns_ruleset=2]
add hide
add path null unhide
add path zero unhide
add path random unhide
add path urandom unhide
add path crypto unhide
add path stdin unhide
add path stdout unhide
add path stderr unhide
```

df -h:

```
[...]
devfs                 1.0K    1.0K      0B   100%    /jails/dns/dev
devfs                 1.0K    1.0K      0B   100%    /jails/www/dev
[...]
```

*The problem:*
At boot, the devfs.rules rules are not loaded and if I drop into the jail and do a ls in /etc, I can see everything the host machine has. However, if I manually restart the jails, the devfs rules are loaded.

I tried putting the rules in /etc/defaults/devfs.rules too (and removed them from /etc/devfs.rules) but didn't work. The behavior is the same.


An I doing something wrong here ?


----------



## da1 (Sep 4, 2010)

in the meantime, I have upgraded to 8.1-release but the weird behavior is still there.

I have installed a clean 8.1 on a vmware and to my surprise, the vmware box is behaving normally.

I checked everything in the fizical box and I could not find anything wrong.


what the hell ?


----------



## da1 (Sep 5, 2010)

SOLVED

I had the following in /etc/fstab:

```
devfs     /jails/www/dev     ufs     rw     0     0
devfs     /jails/dns/dev     ufs     rw     0     0
```

The OS was mounting the /jails/dns/dev folder before the jails were doing their stuff. my mistake.

Anyway, removing those entries from fstab fixed it.


----------



## SirDice (Sep 7, 2010)

By adding *jail_*_devfs_enable="YES"* it is done automatically when the jail starts. There's no need for those entries in /etc/fstab.


----------

