devfs and jails

Chad Leigh -- Shire.Net LLC chad at shire.net
Wed May 12 22:08:35 PDT 2004


On May 12, 2004, at 5:09 PM, Chad Leigh -- Shire.Net LLC wrote:

>
> On May 12, 2004, at 3:37 PM, Chad Leigh -- Shire.Net LLC wrote:
>
>> Hi
>>
>> This is on 5.2-CURRENT
>>
>> I want to apply devfs rules to a jails /dev.  I am starting my jails 
>> manually and not through rc.conf (directly -- I have written my own 
>> rc script to start my jails since I have a bunch of file system stuff 
>> like mounting some localhost nfs and some md device mounts to do as 
>> part of the launch).
>>
>> I noticed that /etc/defaults/devfs.rules has a default set of rules 
>> that one might use with a jail, so I am starting there.  It appears 
>> that this is ruleset 4
>>
>
> Since I am running my stuff inside an rc.d style script, and I noticed 
> a bunch of devfs related routines in /etc/rc.subr I tried the 
> following
>
> devfs_rulesets_from_file /etc/defaults/devfs.rules
> devfs_domount /jail/host/dev devfsrules_jail
>
> in my script.
>

I do not know if this is exactly correct but the following did work for 
me (anything less would not seem to apply the devfs rules)

devfs_rulesets_from_file /etc/defaults/devfs.rules
devfs_domount /jails/host/dev devfsrules_jail
devfs_set_ruleset devfsrules_jail /jails/host/dev
/sbin/devfs -m /jails/host/dev rule -s 4 applyset


thanks
best
Chad



More information about the freebsd-questions mailing list