Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was setting up some udev rules in Ubuntu 12.04 for my APC UPSs and I was using the included *-net.rules as reference. When I used ATTR{}=="" matching in my -ups.rules though it didn't work, I had to switch to ATTRS{}=="" to get it to work; but now I'm wondering: Is the system built in udev rules for eth0 and eth1 broken? Should they be using ATTRS instead of ATTR? How would I check to make sure they are working? How do I even list the ATTRS for the network devices? I can't find a device node on which to run udevadm.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Take a look at udev's manpage:

ATTR{filename}
       Match sysfs attribute values of the event device. Trailing
       whitespace in the attribute values is ignored, if the specified
       match value does not contain trailing whitespace itself.

vs

ATTRS{filename}
       Search the devpath upwards for a device with matching sysfs
       attribute values. If multiple ATTRS matches are specified, all of
       them must match on the same device. Trailing whitespace in the
       attribute values is ignored, if the specified match value does not
       contain trailing whitespace itself.

ATTR{} only looks at the node being added. ATTRS{} searches the tree. It's probably that your UPS needed ATTRS{} because the sysfs attribute that you needed wasn't at the node that you specified.

share|improve this answer
    
badass, thanks. –  Cyclone Jul 19 '12 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.