Bug 54737

Summary: UPS support in halt script at wrong place
Product: [Retired] Red Hat Linux Reporter: Jos Vos <jos>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED DEFERRED QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-29 19:16:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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
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 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 Than Ngo 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
    fi
fi

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
response.

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