- boot.md/mkinitrd-boot.sh: complete any incremental

assembly before attempting to assemble arrays.
  If incremental assembly has partialy assembled
  degraded arrays, now is the time to start them going.
  (bnc#752869)
- mdamd.cron: send daily reports if any arrays are
  degraded.

OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=57
This commit is contained in:
Neil Brown 2012-05-22 05:18:08 +00:00 committed by Git OBS Bridge
parent cb1c6bc876
commit 37dd4e28e9
5 changed files with 54 additions and 0 deletions

View File

@ -125,6 +125,8 @@ case "$1" in
# empty or missing /etc/mdadm.conf, "unused"
rc_status -u
else
# firstly finish any incremental assembly that has started.
$mdadm_BIN -IRs
$mdadm_BIN -A -s -c $mdadm_CONFIG
# a status of 2 is not an error
test $? -eq 0 -o $? -eq 2

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue May 22 05:15:52 UTC 2012 - nfbrown@suse.com
- boot.md/mkinitrd-boot.sh: complete any incremental
assembly before attempting to assemble arrays.
If incremental assembly has partialy assembled
degraded arrays, now is the time to start them going.
(bnc#752869)
- mdamd.cron: send daily reports if any arrays are
degraded.
-------------------------------------------------------------------
Fri May 18 07:16:59 UTC 2012 - nfbrown@suse.com

35
mdadm.cron Normal file
View File

@ -0,0 +1,35 @@
#!/bin/sh
# Run "mdadm --monitor --oneshot" once a day to ensure
# degraded arrays don't go unnoticed.
mdadm_BIN=/sbin/mdadm
mdadm_CONFIG=/etc/sysconfig/mdadm
[ -x $mdadm_BIN ] || exit 0
[ -r $mdadm_CONFIG ] && . $mdadm_CONFIG
if [ x$MDADM_MAIL != x"" ]; then
MDADM_MAIL="-m \"$MDADM_MAIL\""
fi
if [ x$MDADM_PROGRAM != x"" ]; then
MDADM_PROGRAM="-p \"$MDADM_PROGRAM\""
fi
if [ x$MDADM_SCAN = x"yes" ]; then
MDADM_SCAN="-s"
else
MDADM_SCAN=""
fi
if [ x$MDADM_CONFIG != x"" ]; then
MDADM_CONFIG="-c \"$MDADM_CONFIG\""
fi
# using --syslog avoids annoying warnings if no MAIL or PROGRAM are given
# in sysconfig or mdadm.conf
eval $mdadm_BIN -F $MDADM_RAIDDEVICES --oneshot --syslog $MDADM_MAIL $MDADM_PROGRAM $MDADM_SCAN $MDADM_SEND_MAIL $MDADM_CONFIG
exit 0

View File

@ -35,6 +35,7 @@ Source3: mdadmd
Source4: boot.md
Source5: mkinitrd-setup.sh
Source6: mkinitrd-boot.sh
Source7: mdadm.cron
%description
Mdadm is a program that can be used to control Linux md devices. It is
@ -59,6 +60,8 @@ install -m 755 %{S:4} %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/
install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts
install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-md.sh
install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-md.sh
install -d $RPM_BUILD_ROOT/etc/cron.daily
install -m 755 %{S:7} $RPM_BUILD_ROOT/etc/cron.daily/mdadm
install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/
ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd
rm -rf $RPM_BUILD_ROOT/run/mdadm

View File

@ -127,6 +127,9 @@ md_assemble()
fi
}
# run any degraded arrays assembled incrementally
wait_for_events
$mdadm --incremental --run --scan
md_assemble "$resumedev"
md_assemble "$rootdev"
if [ -n "$md_dev" ] ; then