Bug 70027 - initscripts fail to switch off raid devices when ups power fails
initscripts fail to switch off raid devices when ups power fails
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: 2002-07-29 09:53 EDT by Jeremy Sanders
Modified: 2014-03-16 22:29 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-29 16:09: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 Jeremy Sanders 2002-07-29 09:53:22 EDT
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 12:04:47 EDT
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 16:09: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.