[Nut-upsuser] NUT + devd + FreeBSD

Daniel O'Connor doconnor at gsoft.com.au
Tue Oct 30 01:45:13 UTC 2007

I made the following devd script..

cd /tmp
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 's#@RUN_AS_GROUP@#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
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part.
Url : http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20071030/1189f9f9/attachment.pgp 

More information about the Nut-upsuser mailing list