# devfs does not start on boot



## caesius (Dec 28, 2010)

I'm using avrdude to program an MCU. I have a USB programmer found at ugen4.2.

I can only use the programmer as root unless I run

```
/etc/rc.d/devfs start
```
After this is run I can use the programmer as a regular user fine.

Here is my devfs.conf and devfs.rules


```
> view /etc/devfs.rules 
[usb_devices=10]
add path 'usb/*' mode 0777 group usb
add path 'da*s*' mode 0660 group usb

[system=11]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
```


```
> view /etc/devfs.rules
[snip]
perm da0s1 0666
perm usb/4.2.0 0777
```

I thought the rules were loaded on boot? Why is it only after start devfs as root that the programmer works for a normal user?

Cheers.


----------



## SirDice (Dec 28, 2010)

Did you make any modifications to /etc/defaults/rc.conf?


----------



## wblock@ (Dec 28, 2010)

caesius said:
			
		

> ```
> > view /etc/devfs.rules
> [usb_devices=10]
> add path 'usb/*' mode 0777 group usb
> ...



The rules have to be specified in /etc/rc.conf.  The section in brackets defines the name, so you probably should combine the two sets:
/etc/rc.conf

```
devfs_system_ruleset="localrules"
```

/etc/devfs.rules

```
[localrules=10]
add path 'usb/*' mode 0777 group usb
add path 'da*s*' mode 0660 group usb
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
```

That said, devd(8) and /etc/devd.conf are more powerful, and IME, more reliable for dealing with dynamic devices.


----------



## caesius (Dec 28, 2010)

Sorry forgot to mention that they *are* being loaded:

```
blackbox# vi /etc/rc.conf
[snip]
devfs_system_ruleset="usb_devices"
[snip]
devfs_system_ruleset="system"
[snip]
```

So why does my programmer only run after "starting" devfs?


----------



## wblock@ (Dec 28, 2010)

caesius said:
			
		

> Sorry forgot to mention that they *are* being loaded:
> 
> ```
> blackbox# vi /etc/rc.conf
> ...



That only loads the "system" set.  Those are just variable assignments, and the second overwrites the first.


----------

