Bug 54737 - UPS support in halt script at wrong place
UPS support in halt script at wrong place
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-10-17 10:58 EDT by Jos Vos
Modified: 2014-03-16 22:23 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-29 15:16:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jos Vos 2001-10-17 10:58:49 EDT
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
filesystem.

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

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

Fix:
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 11:34:50 EDT
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 16:42:06 EDT
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
    fi
fi
Comment 3 Jos Vos 2001-10-30 16:11:30 EST
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 15:16:57 EDT
Closing bugs on older, no longer supported, releases. Apologies for any lack of
response.

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.