APC Smart-UPS X 1500 Restart Issue. Hi All, I have installed nut-2.4.3. I have manually modified the files apc-hid.c and udev-rules to support 5G APC UPS. I took sample code from the 2.5 development tree. Shutdown process is working very well -- upsmon creates the file /etc/killpower - shutdown script checks for the file and issues /sbin/upsdrvctl shutdown - UPS cuts the power off. All is well. I am facing an issue when power is reapplied to the UPS. Following is the behavior I see: 1. Power comes back to the outlet. 2. System powers up. 3. When system reaches "Starting udev", UPS power cycles again. Above cycle repeats forever. If I cut the power to UPS for ~20 mins and then re-apply power to UPS, system comes back fine. I was searching through the mail-list and I see some other people are experiencing similar issue: Link: http://lists.alioth.debian.org/pipermail/nut-upsuser/2010-July/006118.ht ml I was wondering if there is a resolution for this issue. My environment: [root at DVXSAJ02 etc]# uname -a Linux DVXSAJ02 2.6.20.21-133.xssmp #1 SMP Sat Aug 14 10:13:27 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux [root at DVXSAJ02 etc]# cat /etc/redhat-release CentOS release 5.4 (Final) [root at DVXSAJ02 etc]# upsc scups battery.charge: 89 battery.charge.low: 10 battery.charge.warning: 50 battery.runtime: 1673 battery.runtime.low: 376 battery.type: PbAc battery.voltage: 54.2 battery.voltage.nominal: 48.0 device.mfr: American Power Conversion device.model: Smart-UPS X 1500 device.serial: AS0946124031 device.type: ups driver.flag.pollonly: enabled driver.name: usbhid-ups driver.parameter.offdelay: 20 driver.parameter.ondelay: 30 driver.parameter.pollfreq: 15 driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.4.3 driver.version.data: APC HID 0.95 driver.version.internal: 0.34 ups.beeper.status: enabled ups.delay.shutdown: 20 ups.firmware: COM 02.3 / UPS 02.2 ups.mfr: American Power Conversion ups.mfr.date: 2009/12/19 ups.model: Smart-UPS X 1500 ups.productid: 0003 ups.serial: AS0946124031 ups.status: OL CHRG ups.timer.reboot: -1 ups.timer.shutdown: -1 ups.vendorid: 051d [root at DVXSAJ02 etc]# [root at DVXSAJ02 etc]# cat /etc/sysconfig/ups # If the UPS is locally attached set it to "yes" SERVER=yes # Any options to pass to upsd UPSD_OPTIONS # Added MODEL=upsdrvctl so that /etc/init.d/halt will issue "/sbin/upsdrvctl shutdown" MODEL=upsdrvctl # This *must* be the same as in /etc/ups/upsmon.conf POWERDOWNFLAG=/etc/killpower # # [End] [root at DVXSAJ02 etc]# cat /etc/ups/ups.conf .. [scups] driver = usbhid-ups port = auto desc = "UPS on USB" pollonly offdelay=20 ondelay=30 pollfreq=15 Any suggestion is welcome. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20100820/b63d61b9/attachment.htm>
I have applied a workaround for this issue. I have updated the /etc/init.d/halt to call the following script instead of '/sbin/upsdrvctl shutdown'. [root at DVXSAJ02 ~]# cat /opt/bin/check_ups_status.sh #!/bin/sh # This script is called from /etc/init.d/halt. # Purpose: # If the file /etc/killpower is present, check for UPS status. # If AC is present, reboot system. # If UPS is on battery, sleep and recheck after 30 seconds. # If UPS runs out of battery, system will stop and get powered-on when AC is back. Check BIOS for this setting. # Notes: File system is mounted read-only when this script is called. # $ups_out will contain the following if AC is Present: # 0.087258 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x07, Offset: 2, Size: 1, Value: 1.000000 # $ups_out will contain the following if AC is Not Present: # 0.087237 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x07, Offset: 2, Size: 1, Value: 0.000000 [ ! -f /etc/killpower ] && exit 0 first_time=1 while [ 1 ] do ( sleep 5; /usr/bin/killall usbhid-ups 2> /dev/null ) & ups_out=`/sbin/usbhid-ups -D -a scups 2>&1 | grep UPS.PowerSummary.PresentStatus.ACPresent | grep Input` ac_present=`echo $ups_out | sed 's/.*\<Value\>: \([10]*\).*/\1/'` if [ $ac_present = "1" ]; then echo echo "UPS - AC is present" echo "Rebooting system..." /sbin/reboot exit 0 else if [ $first_time = "1" ]; then echo -n "UPS - On Battery, sleeping..." first_time=0 else echo -n "." fi fi sleep 30 done [root at DVXSAJ02 ~]# This sleeps until AC power returns. When battery runs out, system stop and reboots when power is back. Any comments? ________________________________ From: nut-upsuser-bounces+ajain=dataram.com at lists.alioth.debian.org [mailto:nut-upsuser-bounces+ajain=dataram.com at lists.alioth.debian.org] On Behalf Of Jain, Arvind Sent: Friday, August 20, 2010 11:57 AM To: nut-upsuser at lists.alioth.debian.org Subject: [Nut-upsuser] APC Smart-UPS X 1500 Restart Issue. APC Smart-UPS X 1500 Restart Issue. Hi All, I have installed nut-2.4.3. I have manually modified the files apc-hid.c and udev-rules to support 5G APC UPS. I took sample code from the 2.5 development tree. Shutdown process is working very well -- upsmon creates the file /etc/killpower - shutdown script checks for the file and issues /sbin/upsdrvctl shutdown - UPS cuts the power off. All is well. I am facing an issue when power is reapplied to the UPS. Following is the behavior I see: 1. Power comes back to the outlet. 2. System powers up. 3. When system reaches "Starting udev", UPS power cycles again. Above cycle repeats forever. If I cut the power to UPS for ~20 mins and then re-apply power to UPS, system comes back fine. I was searching through the mail-list and I see some other people are experiencing similar issue: Link: http://lists.alioth.debian.org/pipermail/nut-upsuser/2010-July/006118.ht ml I was wondering if there is a resolution for this issue. My environment: [root at DVXSAJ02 etc]# uname -a Linux DVXSAJ02 2.6.20.21-133.xssmp #1 SMP Sat Aug 14 10:13:27 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux [root at DVXSAJ02 etc]# cat /etc/redhat-release CentOS release 5.4 (Final) [root at DVXSAJ02 etc]# upsc scups battery.charge: 89 battery.charge.low: 10 battery.charge.warning: 50 battery.runtime: 1673 battery.runtime.low: 376 battery.type: PbAc battery.voltage: 54.2 battery.voltage.nominal: 48.0 device.mfr: American Power Conversion device.model: Smart-UPS X 1500 device.serial: AS0946124031 device.type: ups driver.flag.pollonly: enabled driver.name: usbhid-ups driver.parameter.offdelay: 20 driver.parameter.ondelay: 30 driver.parameter.pollfreq: 15 driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.4.3 driver.version.data: APC HID 0.95 driver.version.internal: 0.34 ups.beeper.status: enabled ups.delay.shutdown: 20 ups.firmware: COM 02.3 / UPS 02.2 ups.mfr: American Power Conversion ups.mfr.date: 2009/12/19 ups.model: Smart-UPS X 1500 ups.productid: 0003 ups.serial: AS0946124031 ups.status: OL CHRG ups.timer.reboot: -1 ups.timer.shutdown: -1 ups.vendorid: 051d [root at DVXSAJ02 etc]# [root at DVXSAJ02 etc]# cat /etc/sysconfig/ups # If the UPS is locally attached set it to "yes" SERVER=yes # Any options to pass to upsd UPSD_OPTIONS # Added MODEL=upsdrvctl so that /etc/init.d/halt will issue "/sbin/upsdrvctl shutdown" MODEL=upsdrvctl # This *must* be the same as in /etc/ups/upsmon.conf POWERDOWNFLAG=/etc/killpower # # [End] [root at DVXSAJ02 etc]# cat /etc/ups/ups.conf .. [scups] driver = usbhid-ups port = auto desc = "UPS on USB" pollonly offdelay=20 ondelay=30 pollfreq=15 Any suggestion is welcome. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20100823/06dfa52d/attachment-0001.htm>
Arjen de Korte
2010-Aug-29 12:08 UTC
[Nut-upsdev] [Nut-upsuser] APC Smart-UPS X 1500 Restart Issue.
Citeren "Jain, Arvind" <AJain op dataram.com>:> This sleeps until AC power returns. When battery runs out, system stop > and reboots when power is back.First of all, it is a terribly bad idea to run a driver in debug mode on a production system. It should be used for testing purposes only. The problem is caused by the driver failing to detect a working 'load.on.delay' command for the UPS, which is needed to create the two-step 'shutdown.return' command. Either your UPS doesn't have one, or it is put in a vendor specific HID path. Because of this, the driver will fallback to the 'shutdown.reboot' command, which seems to be horribly broken for your UPS. It would be helpful if you could post the output of /sbin/usbhid-ups -DD -a scups 2>&1 here, so that we can see if there might be another HID path that could be used. Chances are, that we just need to call 'load.off.delay' and that the device will return power all by itself. This violates the HID Power Device Specification, but since the 'shutdown.reboot' also is non-compliant, I'm not too surprised. Best regards, Arjen -- Please keep list traffic on the list (off-list replies will be rejected)
Seemingly Similar Threads
- APC Smart-UPS X 1500 Restart Issue.
- Operation Not Supported error for GETXATTR when VFS plugin "nfs4acl_xattr" is used
- [Bug 1264] Channel not close by sshd Server
- Operation Not Supported error for GETXATTR when VFS plugin "nfs4acl_xattr" is used
- interrupt pipe disabled