Accessing /dev/lpt0 in a Jail

Mel fbsd.questions at rachie.is-a-geek.net
Mon Feb 23 23:32:31 PST 2009


On Monday 23 February 2009 12:32:39 Jasvinder S. Bahra wrote:

> [root at pearl ~]# ls -al /dev/lpt*
> crw-------  1 root  wheel    0,  53 Feb 23 21:11 /dev/lpt0
> crw-------  1 root  wheel    0,  54 Feb 23 21:11 /dev/lpt0.ctl
>
> I need the device nodes to have 0660 permissions and root:cups ownership. 
> I can easily make these changes using the chown and chmod tools, but the
> changes do not survive a system reboot.  Following some further research, I
> understand I can make these changes occur automatically by adding some
> entries in the jail's /etc/devfs.conf file...

You should repeat this to yourself, about 10-20 times, daily, so you don't 
forget ;)
devfs.conf is for devices available at boot time, but devfs.rules rule after

Ergo, making changes to devfs.conf does nothing till the next boot.

> I also tried creating a device ruleset in the jail (i.e. creating a
> /etc/devfs.rules file in the jail)...
>
> [localrules=5]
> add path 'lpt*' mode 0660 group cups
>
> ...and then applying that ruleset by adding the following to the jail's
> /etc/rc.conf

Prisoners don't get to decide which doors are opened. Thus, devfs_* is 
completely ignored inside prison walls. The host sets up the 
${JAIL_ROOT}/dev.
In the hosts /etc/devfs.rules, you can set:
[devfsrules_jail_pearl=5]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'lpt*' mode 0660 group cups unhide

Then add to /etc/rc.conf:
jail_pearl_devfs_ruleset="devfsrules_jail_pearl"

Inform with ezjail author how to make this ez ;)

-- 
Mel

Problem with today's modular software: they start with the modules
    and never get to the software part.


More information about the freebsd-questions mailing list