I made the following devd script..

sh
cd /tmp
fetch 
mkdir /usr/local/etc/devd
sed -Ene 's/SYSFS\{idVendor\}==\"(.*)\", SYSFS\{idProduct\}==\"(.*)\", 
MODE=.*/attach 100 {\
        device-name "ugen[0-9]+";\
        match "vendor"  "0x\1";\
        match "product" "0x\2";\
        action "chown @RUN_AS_GROUP@ \/dev\/$device-name*; chmod 660 
\/dev\/$device-name*";\
};\
/p' </usr/ports/sysutils/nut/work/nut-2.2.0/scripts/udev/nut-usbups.rules.in | 
sed -e '[EMAIL PROTECTED]@#uucp#g' > /usr/local/etc/devd/nut.conf
/etc/rc.d/devd restart

Unfortunately the uucp user is not in operator so it can't search the USB
bus and hence the above doesn't work 100%.

I think probably the best way would be to make a nutmon user that is a member 
of the uucp and operator group.

I did that with..
echo '*LOCKED*' | pw useradd nutmon -u 95 -c 'NUT monitor user' -d /var/empty 
-g operator -G dialer -s /usr/sbin/nologin -H 0
then..
cd /usr/ports/sysutils/nut
make NUT_USER=nutmon NUT_GROUP=operator

And re-run the sed above but with operator instead of uucp.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to