APC SU1400XLT User Manual Page 15

  • Download
  • Add to my manuals
  • Print
  • Page
    / 115
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 14
Modern Linux distributions using the 2.6 kernel create device nodes dynamically 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.
Some early 2.6 distributions (Fedora Core 3, for one) do not include hiddev rules in their default udev rule
set. The bottom line for apcupsd on such a system is that if the hiddevN is not created when you plug in
your UPS, apcupsd will terminate with an 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"
Note that this rule uses obsolete udev syntax and is specific to FC3 and other distributions of similar
vintage.
Then either reboot your system, or unplug and replug your UPS and then restart apcupsd. At that point a
/dev/usb/hiddevN node should appear and apcupsd should work fine.
If you have several UPSes or you just want to give your UPS a fixed name, you can use rules like the
following:
KERNEL=="hiddev*", SYSFS{serial}=="JB0319033692", SYMLINK="ups0"
KERNEL=="hiddev*", SYSFS{serial}=="JB0320004845", SYMLINK="ups1"
Note that this rule uses udev syntax that is appropriate only for distros such as RHEL4 and FC4 and
others of a similar vintage.
More recent distros such as FC15 should use something like this:
KERNEL=="hiddev*", ATTRS{manufacturer}=="American Power Conversion", ATTRS{serial}=="BB0100009999 ", OWNER="root", SYMLINK+="ups0"
Replace the serial number in quotes with the one that corresponds to your UPS. Then whenever you plug
in your UPS a symlink called ups0, ups1, etc. will be created pointing to the correct hiddev node. This
technique is highly recommended if you have more than one UPS connected to the same server since
rearranging your USB cables or even upgrading the kernel can affect the order in which devices are
detected and thus change which hiddev node corresponds to which UPS. If you use the
symlink-by-serial-number approach the link will always point to the correct device node.
You can use...
udevinfo -a -p /sys/class/usb/hiddev0/
...to get more information on the fields that can be matched besides serial number.
To find the available attributes to match (note that the serial is NOT always the UPS serial on the box or in
the USB connect message in /var/log/messages), use:
udevadm info --attribute-walk --name=/dev/usb/hiddev0
An additional device-node-related problem is the use of dynamic minors. Some distributions, such as
Mandrake 10, ship with a kernel having CONFIG_USB_DYNAMIC_MINORS turned on. This is not ideal for
running with apcupsd, and the easiest solution is to turn CONFIG_USB_DYNAMIC_MINORS off and rebuild
your kernel, or find a pre-built kernel with it off. For a kernel with CONFIG_USB_DYNAMIC_MINORS turned
on to work with apcupsd, you must enable devfs. The following will tell you if devfs is enabled:
$ ps ax | grep devs
...which should give something like the following:
Page view 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 114 115

Comments to this Manuals

No comments