Bug 34312 - Missing shutdown procedures (qa0328 and all other)
Summary: Missing shutdown procedures (qa0328 and all other)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: nut
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Brian Brock
URL:
Whiteboard:
: 37273 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-04-01 21:33 UTC by Michal Jaegermann
Modified: 2007-04-18 16:32 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-04-01 21:33:37 UTC
Embargoed:


Attachments (Terms of Use)

Description Michal Jaegermann 2001-04-01 21:33:34 UTC
If I am reading a documentation to this package properly (not an easy
task as these docs may use a thorough rewrite) then /etc/rc.d/init.d/halt
script is missing shutdown procedures for UPS itself required when
such device is present (see 'shutodown.txt' in the said documentation).

I think that the following, inserted in 'halt' just before the last
line, would do:

switchoff_ups () {
    [ -r /etc/ups/upsmon.conf ] || return
    POWERDOWNFLAG=$( /bin/grep '^POWERDOWNFLAG' /etc/ups/upsmon.conf \
        | while read id pf rest ; do
            echo $pf
            break
        done )
    [ -f $POWERDOWNFLAG ] || return
    [ -f /etc/sysconfig/ups ] || return
    . /etc/sysconfig/ups
    [ "$SERVER" != "yes" -o "$MODEL" = "NONE" \
        -o "$MODEL" = "" -o "$DEVICE" = "" ] && return
    /usr/bin/$MODEL -k $DEVICE
}

[ "$command" = halt ] && switchoff_ups

if not for that small catch that /usr/bin may be already gone.
So either various ups drivers have to live in a place like /sbin
(actually they likely should be there) or 'halt' has to keep /usr/bin,
mounted read-only, to the last moment.

  Michal
  michal

Comment 1 Ngo Than 2001-04-23 23:00:46 UTC
It's fixed in initscripts-5.84. Thanks

Comment 2 Ngo Than 2001-04-23 23:01:25 UTC
*** Bug 37273 has been marked as a duplicate of this bug. ***


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