CONFIG USB, CONFIG USB HID, CONFIG USB HIDDEV, and CON-
FIG
USB DEVICEFS as well as at least one USB Host Controller Driver
(CONFIG USB UHCI HCD [2.6.x], CONFIG USB UHCI [2.4.x], etc.).
If CONFIG USB is set as M, CONFIG USB HID must be M (if enabled
at all). If CONFIG USB is set as Y, CONFIG USB HID can be M or Y.
hiddev, in turn, will be built however HID is.
To complicate things more many Linux flavors running 2.6 kernels such as
Fedora FC3 use the udev filesystem, which creates the devices in /dev (as
well as some others such as network devices) on the fly as they are needed.
It is basically a hotplug system, giving a lot more power to the user to
determine what happens when a device is probed or opened. It is also a lot
more complicated.
The bottom line for apcupsd on such a system is that the file
/dev/usb/hiddev# is not defined, and hence apcupsd terminates in error.
The solution to the problem is to add a rule to the udev rules file. On Fedora
FC3, this file is found in /etc/udev/rules.d/50-udev.rules. Start by adding
the following line:
BUS="usb", SYSFS[idVendor]="051d", NAME="usb/hiddev%n"
where you replace the [ and ] with braces in the line above.
Then either reboot your system, or unplug and replug your UPS and then
restart apcupsd. At that point apcupsd should work fine. You can use:
udevinfo -a -p /sys/class/usb/hiddev0/
to get more information on the fields that can be matched.
Adam has provided the following as a more generic rule:
KERNEL="hiddev*", NAME="usb/hiddev%n"
If you have several UPSes or you just want to give your UPS a fixed name,
you can use:
BUS="usb", SYSFS[serial]="AS0123456789", NAME="usb/ups0"
25