# devfs rules



## Windmill (May 7, 2016)

Hi, in the CUPS part of the handbook it says to add this to /etc/devfs.rules

```
[system=10]
add path 'unlpt*' mode 0660 group cups 
add path 'ulpt*' mode 0660 group cups 
add path 'lpt*' mode 0660 group cups 
add path 'usb/X.Y.Z' mode 0660 group cups
```
And to /etc/rc.conf

```
devfs_system_ruleset="system"
```

But to mount USB I need this

```
[localrules=5]
add path 'da*' mode 0660 group operator
```
And in rc.conf

```
devfs_system_ruleset="localrules"
```

So how can I add both?


----------



## rudelgurke (May 8, 2016)

Why not merge both rules ?

Something like:


```
[system=10]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
add path 'usb/X.Y.Z' mode 0660 group cups
add path 'da*' mode 0660 group operator
```

And using devfs_system_ruleset="system"


----------



## kpa (May 8, 2016)

You can "cascade" the rules by including another set of rules to your rules, this is from /etc/defaults/devfs.rules the ruleset that can be used for jails as it is:


```
# Devices usually found in a jail.
#
[devfsrules_jail=4]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path zfs unhide
```

I left out the earlier entries devfsrules_hide_all, devfsrules_unhide_basic and devfsrules_unhide_login, they have to be present in the ruleset or you'll get an error.


----------



## Windmill (May 18, 2016)

rudelgurke said:


> Why not merge both rules ?
> 
> Something like:
> 
> ...


Ok, I didn't know I could do that, I thought that I should set both [system=10] and [localrules=5] and I couldn't put rules together. Thanks


----------

