From b4f2199395802d5a811496a83b36a4ec3fc7f7f719676637d7ad3194d997200a Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 18 Aug 2011 06:32:28 +0000 Subject: [PATCH] - boot.md: improve 'status' and add 'reload' function. Also change 'Raid' to 'RAID' for consistency (bnc#709474) OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=41 --- boot.md | 27 +++++++++++++++++++++------ mdadm.changes | 7 +++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/boot.md b/boot.md index cabf90a..7d63a3e 100644 --- a/boot.md +++ b/boot.md @@ -1,6 +1,6 @@ #!/bin/sh # -# SUSE system startup script for MD Raid autostart +# SUSE system startup script for MD RAID autostart # Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc. # Copyright (C) 2006 Marian Jancar, SUSE / Novell Inc. # @@ -96,7 +96,7 @@ function _rc_exit { case "$1" in start) - echo -n "Starting MD Raid " + echo -n "Starting MD RAID " # create the /var/run/mdadm symlink if needed mkdir -p /dev/.mdadm @@ -137,17 +137,32 @@ case "$1" in fi ;; stop) - echo -n "Shutting down MD Raid " - + echo -n "Not shutting down MD RAID - reboot/halt scripts do this." + rc_failed 3 # Remember status and be verbose rc_status -v ;; status) - rc_failed 4 + echo -n "MD RAID arrays:" + count=`grep -c ' active ' /proc/mdstat 2> /dev/null` + case $count in + 0 ) echo -n " No arrays active"; rc_failed 3;; + 1 ) echo -n " 1 array active";; + * ) echo -n " $count arrays active";; + esac + + rc_status -v + ;; + reload) + # We cannot really reload the kernel module, or reassemble the + # arrays, but we can restart mdmon. It will replace existing + # mdmon, or exit quietly if there is nothing to do. + echo -n "MD RAID: restarting mdmon if it is needed." + /sbin/mdmon --all --takeover rc_status -v ;; *) - echo "Usage: $0 {start|stop|status}" + echo "Usage: $0 {start|stop|status|reload}" exit 1 ;; esac diff --git a/mdadm.changes b/mdadm.changes index 2ff2c79..2de1c20 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Aug 18 06:30:45 UTC 2011 - nfbrown@novell.com + +- boot.md: improve 'status' and add 'reload' + function. Also change 'Raid' to 'RAID' + for consistency (bnc#709474) + ------------------------------------------------------------------- Thu Aug 18 06:01:39 UTC 2011 - nfbrown@novell.com