Accepting request 249485 from Base:System

- Add cron job to run 'mdcheck' regularly to
  verify all md arrays. (bnc#869261)

OBS-URL: https://build.opensuse.org/request/show/249485
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=96
This commit is contained in:
Stephan Kulow 2014-09-17 19:23:25 +00:00 committed by Git OBS Bridge
commit b2abbd83b3
4 changed files with 49 additions and 2 deletions

9
cron.d.mdadm Normal file
View File

@ -0,0 +1,9 @@
#
# cron.d/mdadm - regular redundancy checks
#
# Start checking each month early in the morning.
# Continue each day until all done
0 1 * * 0 root source /etc/sysconfig/mdadm; [ -n "$MDADM_CHECK_DURATION" -a -x /usr/share/mdadm/mdcheck -a $(date +\%d) -le 7 ] && /usr/share/mdadm/mdcheck --duration "$MDADM_CHECK_DURATION"
0 1 * * 1-6 root source /etc/sysconfig/mdadm; [ -n "$MDADM_CHECK_DURATION" -a -x /usr/share/mdadm/mdcheck ] && /usr/share/mdadm/mdcheck --continue --duration "$MDADM_CHECK_DURATION"

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Sep 16 01:04:36 UTC 2014 - nfbrown@suse.com
- Add cron job to run 'mdcheck' regularly to
verify all md arrays. (bnc#869261)
-------------------------------------------------------------------
Fri Jul 25 11:48:12 UTC 2014 - p.drouand@gmail.com

View File

@ -28,7 +28,6 @@ BuildRequires: pkgconfig(systemd)
PreReq: %fillup_prereq /sbin/mkinitrd
Recommends: cron
Recommends: smtp_daemon
Obsoletes: raidtools
Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/
Summary: Utility for Configuring MD Setup
License: GPL-2.0
@ -37,6 +36,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz
Source1: Software-RAID.HOWTO.tar.bz2
Source2: sysconfig.mdadm
Source3: cron.d.mdadm
Source7: mdadm.cron
# PATCH-FIX-UPSTREAM 0001-Makefile-install-mdadm-grow-continue-.service.patch nfbrown@suse.de
Patch1: 0001-Makefile-install-mdadm-grow-continue-.service.patch
@ -66,17 +66,32 @@ sgml2txt Software-RAID.HOWTO.sgml
make install install-systemd install-udev DESTDIR=%{buildroot} SYSTEMD_DIR=%{_unitdir} UDEVDIR=%{_udevdir} SUSE=yes
rm -rf %{buildroot}/lib/udev
install -d %{buildroot}%{_var}/adm/fillup-templates
install -d %{buildroot}{%{_sbindir}
install -d %{buildroot}/usr/share/mdadm
install -m 755 misc/mdcheck %{buildroot}/usr/share/mdadm/mdcheck
install -d %{buildroot}/etc/cron.daily
install -d %{buildroot}/etc/cron.d
install -m 755 %{S:7} %{buildroot}/etc/cron.daily/mdadm
install -m 644 %{S:3} %{buildroot}/etc/cron.d/mdadm
install -m 644 %{S:2} %{buildroot}%{_var}/adm/fillup-templates/
install -d %{buildroot}%{_systemdshutdowndir}
install -d %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcmdmonitor
%define services mdmonitor.service mdmon@.service mdadm-last-resort@.service mdadm-grow-continue@.service
%pre
%service_add_pre %services
%post
%service_add_post %services
%{?regenerate_initrd_post}
%fillup_only
%preun
%service_del_preun %services
%postun
%service_del_postun %services
%{?regenerate_initrd_post}
%posttrans
@ -88,11 +103,16 @@ install -d %{buildroot}%{_systemdshutdowndir}
%doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html}
%doc %{_mandir}/man?/*
/sbin/*
%{_sbindir}/rcmdmonitor
%dir /usr/share/mdadm
/usr/share/mdadm/*
%{_var}/adm/fillup-templates/sysconfig.mdadm
%{_udevdir}/rules.d/63-md-raid-arrays.rules
%{_udevdir}/rules.d/64-md-raid-assembly.rules
%dir /etc/cron.daily
/etc/cron.daily/mdadm
%dir /etc/cron.d
%config /etc/cron.d/mdadm
%{_systemdshutdowndir}/mdadm.shutdown
%{_unitdir}/mdmon@.service
%{_unitdir}/mdmonitor.service

View File

@ -60,3 +60,15 @@ MDADM_SEND_MAIL_ON_START=no
# increased. Setting this to '0' disables waiting for udev.
#
MDADM_DEVICE_TIMEOUT="60"
## Type: string
## Default: 6 hours
#
# Amount of time to spend checking md arrays each morning.
# A check will start on the first Sunday of the month and run
# for this long. If it does not complete, then it will be
# continued each subsequent morning until all arrays have
# been checked. Any string understood by "date --date="
# can be used. An empty string disables automatic checks.
#
MDADM_CHECK_DURATION="6 hours"