Bug 54737 - UPS support in halt script at wrong place
Summary: UPS support in halt script at wrong place
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.3
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2001-10-17 14:58 UTC by Jos Vos
Modified: 2014-03-17 02:23 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2005-09-29 19:16:57 UTC

Attachments (Terms of Use)

Description Jos Vos 2001-10-17 14:58:49 UTC
Description of Problem:
In one of the last statements in /etc/rc.d/init.d/halt a $MODEL -k $DEVICE
command is executed to power down the UPS (when configured).  However,
these UPS-specific commands are in /usr/bin, so when you have a separate
/usr filesystem, this filesystem is already unmounted at this moment. 
Conclusion: the will *never* work on any system with a separate /usr

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

How Reproducible:
On any system with an UPS configured and a seperate /usr filesystem.

The command could be moved up in the script before filesystems are
unmounted. Maybe this works, but what about NFS-mounted /usr filesystems? 
Or should the UPS daemons go to /bin instead of /usr/bin?

Comment 1 Jos Vos 2001-10-17 15:34:50 UTC
Moving the command before unmounting the filesystems doesn't work either, as
then the command (apcsmart in my case) blocks several seconds and then powers
down the UPS before the halt script proceeds... :-(.

Putting apcsmart in /bin and using the original halt script doesn't work as
expected, as it blocks a while and then indeed powers down the system, but
without any delay so that the halt script finishes correctly.  It might be able
to call apcsmart in a proper way, but standard it doesn't work ok.  Technically
this should be possible, as smupsd also tells a Smart-UPS to power down, but
with a 20 seconds delay.

Comment 2 Ngo Than 2001-10-17 20:42:06 UTC
could you please try to add -d0 into /etc/init.d/halt if it works.

if [ "$command" = halt ] ; then
    if [ -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ]
; then
        . /etc/sysconfig/ups
        [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE"
] && $MODEL -d0 -k $DEVICE

Comment 3 Jos Vos 2001-10-30 21:11:30 UTC
Yes, adding -d0 seems to work fine. So, now there should be defined an
additional variable in /etc/sysconfig/ups to enable this kind of options. Maybe
the current OPTIONS should be split into OPTIONS_START and OPTIONS_HALT or so...

Comment 4 Bill Nottingham 2005-09-29 19:16:57 UTC
Closing bugs on older, no longer supported, releases. Apologies for any lack of

If this persists on a current release, such as Fedora Core 4, please open a new bug.

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