Bug 70027 - initscripts fail to switch off raid devices when ups power fails
Summary: initscripts fail to switch off raid devices when ups power fails
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-07-29 13:53 UTC by Jeremy Sanders
Modified: 2014-03-17 02:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-29 20:09:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Jeremy Sanders 2002-07-29 13:53:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722

Description of problem:
If a ups is being monitored by nut (network ups tools, included with RH) to
watch for powerouts, and if the root device is on a raid device (not tested if
it isn't but I think this is true if _any_ device is on raid), then  the
shutdown script fails to switch off the raid device on a powerfail shutdown.
This means the raid array has to resync when the power returns (defeating the
whole point of the ups).

/etc/init.d/halt contains:

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 -k $DEVICE
    fi
fi

This means it calls the upsdriver with -k, killing off the power. Because the
kernel never gets to a "Power down" state, the raid array is still active. This
means it needs to get synced on reboot.

As a workaround, I could get rid of the $MODEL -k $DEVICE command and just let
the power run out. Is there some way to force the raid device to switch off
before the $MODEL -k $DEVICE command?




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


How reproducible:
Always

Steps to Reproduce:
1. Construct root on raid 1 device
2. Set up NUT to monitor UPS
3. Disconnect UPS
4. Wait for switch off
5. Turn power on

	

Actual Results:  Raid device starts resync (see /proc/mdstat)

Expected Results:  Raid device should cleanly switch off.


Additional info:

Comment 1 Jeremy Sanders 2002-07-30 16:04:47 UTC
Doing some debugging it seems the nut command:
 $MODEL -k $DEVICE
command tells the UPS to switch the power off and then waits for 90s in a sleep,
hoping the power will go off! This means the kernel halt never happens. If you
adjust the "grace period" of the UPS to shut down to greater than 90s (3 mins on
our APC ups), then the nut command completes (the sleep times out), and the
kernel actually shuts down, halting the raid devices.

I assume the 90s wait is so the kernel never shuts down and so when the power
comes back an ATX motherboard will come back up (rather than sitting in a shut
down state).

Comment 2 Bill Nottingham 2005-09-29 20:09: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.


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