Hi all - I'm running into a small problem with the CyberPower CP425HG UPS and NUT 2.4 on Fedora 11. For whatever reason, at system startup this UPS registers as a USB device very late in the boot process, *after* all the services have started. So at boot up when the "ups" service in init.d tries to start "upsdrvctl", it fails because no USB UPS device cannot be found. Hence the auto-shutdown on low battery does not work. This all works great if I start the ups service manually ("service ups start") after the system has booted up. I'm not sure how to fix this, other than to perhaps start the "ups" service from the udev rules file if a known USB UPS device has been found, but that seems like a rather ugly way to go about this. Does anyone have any thoughts? System information: Fedora 11, Kernel 2.6.30, NUT 2.4.3 UPS product page: http://www.cyberpowersystems.com/products/ups-systems/soho-ups/CP425HG.html Thanks, Arun
Charles Lepple
2011-Apr-01 02:25 UTC
[Nut-upsuser] Startup timing issue with CyberPower CP425HG UPS
On Mar 30, 2011, at 9:46 PM, Arun wrote:> I'm not sure how to fix this, other than to perhaps start the "ups" > service from the udev rules file if a known USB UPS device has been > found, but that seems like a rather ugly way to go about this. Does > anyone have any thoughts?I have had a sneaking suspicion that in some situations, starting a USB driver from hotplug or udev might work better, and this is definitely one of those cases. Before you get too far into this, you probably want to make sure that when power returns, your UPS will wait until the battery is charged to some threshold before powering on its outlets. Otherwise, if the power goes off-on-off (with a shutdown after the first power failure), the UPS might try to start the computer up with a discharged battery, and due to the delay in connecting to the UPS, NUT would not get the low battery signal in time to shut down properly the second time. The other trick is that the current NUT USB drivers will attempt to reattach to a device if it disappears. Especially during testing, it is helpful to be able to unplug and re-plug the UPS into the USB port. For this to work, the udev script could kill the driver which is waiting around for the UPS to come back. (That would only do the right thing on a single-UPS system.) Alternatively, you could check in the udev script to see if any of the USB drivers are running (look for the PID files, and run "kill -0" to see if the process is still around without actually terminating it). On the other hand, you can also look into whether your startup scripts have configurable dependencies, and tell the NUT init.d script to start after the USB service has fully initialized. Not sure how that works in Fedora.
Possibly Parallel Threads
- [HCL] CyberPower Systems PR6000LCDRTXL5U supported by usbhid-ups
- [HCL] CyberPower EC350G supported by usbhid-ups
- [HCL] CyberPower OR700 supported by usbhid-ups
- [HCL] CyberPower LE825G supported by Cyber Power Systems ups 2 685AVR USB (usbhid-ups) driver
- Yet another HID device - Cyberpower AE550