Bug 164531 - final shutdown for USB based UPS's fails
final shutdown for USB based UPS's fails
Product: Fedora
Classification: Fedora
Component: nut (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Ngo Than
Brian Brock
Depends On:
Blocks: 164524
  Show dependency treegraph
Reported: 2005-07-28 11:30 EDT by Alfred Ganz
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: FC5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-04-24 12:54:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alfred Ganz 2005-07-28 11:30:34 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050719 Fedora/1.7.10-1.3.1

Description of problem:
At the end of /etc/init.d/halt, a UPS driver program may be called to turn off
the UPS. The driver programs for USB based UPS devices are currently
dynamically linked with libusb.so, which resides in /usr/lib, but /usr has been unmounted at this point.

I have suggested that the driver programs in question be linked statically
with libusb, but have been told that this is not suitable, and to ask that
libusb.so be installed in /lib.

I don't really care how this problem is solved, but in order to make USB based
UPS driver programs work, they must work at the end of /etc/init.d/halt.

Note that in addition to this problem, /etc/init.d/halt needs to delay the
umount of /proc/bus/usb until after the above code. I have filed bug 164524
for this.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.ldd /sbin/newhidups  

Additional info:
Comment 1 Fabrice Bellet 2006-02-07 15:48:04 EST
. I agree with Alfred, that the /etc/init.d/halt script needs some love, when
handling the /etc/killpower case :

. A possible workaround for Alfred's last note, about the missing /proc/bus/usb
usbfs, is to remount it just before issuing the ups shutdown command. In this
case, a "-u root" option must be added to this command, because the usb device
in the usbfs tree is no longer with the right 'nut' group, after remount.

. Another problem with the current script, is that $DEVICE is supposed to
contains a value, but this is not mandatory, if this information is in
/etc/ups/ups.conf instead, and if the $MODEL command is launched with the "-a
<myups>" option. I suggest to use the same invokation than in /etc/init.d/nut : 
/sbin/$MODEL -u root -k $OPTIONS $DEVICE, and to remove the test "-n $DEVICE"
just above.
(btw, what's the purpose of $OPTIONS_HALT here ?, this options is not documented
in /etc/sysconfig/ups)

. The problem is still in FC4, and rawhide.
Comment 2 Ngo Than 2006-04-24 12:54:07 EDT
it's now fixed in FC5 release. Thanks for your report.

Note You need to log in before you can comment on or make changes to this bug.