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. There are now new UPS driver programs that are USB based. In order for them to work, /proc/bus/usb/devices must be available read/write at that time. I think there is no problem delaying the umount for /proc/bus/usb/devices and the remounting of /proc until after the above code. Doing so unfortunately gets relatively ugly. I will attach my hack, but please do it better! Version-Release number of selected component (if applicable): initscripts-7.93.7-1 How reproducible: Always Steps to Reproduce: 1.run on the UPS and wait for the low battery shutdown 2.read the error message if you can! 3. Additional info: --- halt.orig 2004-10-03 23:20:19.000000000 -0400 +++ halt 2005-07-28 09:48:40.000000000 -0400 @@ -193,20 +193,28 @@ retry=$(($retry-1)) sig=-9 done -[ -f /proc/bus/usb/devices ] && umount /proc/bus/usb +##AG## We need this for shutting down any USB based UPS's +##AG## [ -f /proc/bus/usb/devices ] && umount /proc/bus/usb # remove the crash indicator flag rm -f /.autofsck # Try all file systems other than root and RAM disks, one last time. -mount | awk '!/( \/ |^\/dev\/root|^\/dev\/ram| \/proc )/ { print $3 }' | \ +##AG## We need to keep /proc/bus/usb around to shut any USB based UPS's +##AG# mount | awk '!/( \/ |^\/dev\/root|^\/dev\/ram| \/proc )/ { print $3 }' | \ +mount | awk \ + '!/( \/ |^\/dev\/root|^\/dev\/ram| \/proc | \/proc\/bus\/usb )/ { print $3 }' | \ while read line; do umount -f $line done # Remount read only anything that's left mounted. # echo $"Remounting remaining filesystems readonly" -mount | awk '{ print $3 }' | while read line; do +##AG## Don't do this for /proc and /proc/bus/usb, +##AG## we need /proc/bus/usb rw for shutting down any USB based UPS's +##AG## mount | awk '{ print $3 }' | while read line; do +mount | awk '!/( \/proc | \/proc\/bus\/usb )/ { print $3 }' | \ + while read line; do mount -n -o ro,remount $line done @@ -225,8 +233,13 @@ elif [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE" ] ; then $MODEL $OPTIONS_HALT -k $DEVICE fi + sleep 100 fi +#AG## Now, if we didn't shut power, this can finally all be sorted out +[ -f /proc/bus/usb/devices ] && umount /proc/bus/usb +mount -n -o ro,remount /proc + if [ -x /sbin/halt.local ]; then /sbin/halt.local fi
Note, in addition to the above, said UPS driver programs must be made to work after /usr has been unmounted. I have filed a bug 164531 for this.
. The problem still exists in FC4 . Additionnal care must be taken with the params taken from /etc/sysconfig/ups, see bug 164531, comment #1.
Why do you need /proc/bus/usb? Is it to write to the device files with libusb?
You are correct, the UPS needs to be told to turn off the power to the system, AND to set itself ready to catch line power coming back. In the olden days this typically implied a hardwired tty line, so not much of a problem, but now we need a significant amount of infrastructure just before we quit.
OK, this should be solved in the devel tree, as libusb has been changed to use the device nodes udev creates under /dev.
I just hope that it will be done in a way that avoids the current complexity of determining which out of multiple similar devices that has led to grabbing the device in the usb tree. Have a look at the machinations that newhidups of the nut package goes through!