[mdadm/f18] Launch mdmon via systemctl to avoid it ending up in the wrong cgroup

Jes Sorensen jsorensen at fedoraproject.org
Mon Jan 21 13:40:58 UTC 2013


commit 352851ee4a9169aa3d5dc159ccff65ecf8f1e1ed
Author: Jes Sorensen <Jes.Sorensen at redhat.com>
Date:   Mon Jan 21 14:36:26 2013 +0100

    Launch mdmon via systemctl to avoid it ending up in the wrong cgroup
    
    Resolves bz879327
    
    Signed-off-by: Jes Sorensen <Jes.Sorensen at redhat.com>

 mdadm-3.2.6-cgroup.patch |   38 --------------------------------------
 mdadm.spec               |   45 +++++++++++++++++++++++++++------------------
 2 files changed, 27 insertions(+), 56 deletions(-)
---
diff --git a/mdadm.spec b/mdadm.spec
index fd10d8c..6a22265 100644
--- a/mdadm.spec
+++ b/mdadm.spec
@@ -1,7 +1,7 @@
 Summary:     The mdadm program controls Linux md devices (software RAID arrays)
 Name:        mdadm
 Version:     3.2.6
-Release:     11%{?dist}
+Release:     12%{?dist}
 Source:      http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz
 Source1:     mdmonitor.init
 Source2:     raid-check
@@ -9,15 +9,17 @@ Source3:     mdadm.rules
 Source4:     mdadm-raid-check-sysconfig
 Source5:     mdadm-cron
 Source6:     mdmonitor.service
-Source8:     mdadm.conf
-Source9:     mdadm_event.conf
-Patch0:      mdadm-3.2.6-cgroup.patch
+Source7:     mdmon-offroot at .service
+Source8:     mdmon at .service
+Source9:     mdadm.conf
+Source10:    mdadm_event.conf
 Patch1:	     mdadm-3.2.6-Create.c-check-if-freesize-is-equal-0.patch
 Patch2:	     mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch
+Patch96:     mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch
 # Fedora customization patches
 Patch97:     mdadm-3.2.6-udev.patch
 Patch98:     mdadm-2.5.2-static.patch
-# Fedora 15, 16, 17 - only
+# Fedora 16, 17 - only
 Patch99:     mdadm-3.2.4-map-dir.patch
 URL:         http://www.kernel.org/pub/linux/utils/raid/mdadm/
 License:     GPLv2+
@@ -26,18 +28,15 @@ BuildRoot:   %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes:   mdctl,raidtools
 %if "%{fedora}" >= "18"
 Obsoletes:   mdadm-sysvinit
-%endif
-BuildRequires: systemd-units binutils-devel
-%if "%{fedora}" <= "17"
-Requires(post): systemd-units systemd-sysv chkconfig coreutils
-%else
+Conflicts:   dracut < 024-23
 Requires(post): systemd-units chkconfig coreutils
+%else
+Requires(post): systemd-units systemd-sysv chkconfig coreutils
+Requires: udev initscripts
 %endif
+BuildRequires: systemd-units binutils-devel
 Requires(preun): systemd-units
 Requires(postun): systemd-units coreutils
-%if "%{fedora}" <= "17"
-Requires: udev initscripts
-%endif
 %if "%{fedora}" >= "17"
 Requires: libreport-filesystem
 Conflicts: dracut < 009-14
@@ -66,9 +65,9 @@ is not used as the system init process.
 
 %prep
 %setup -q
-# Only apply cgroups workaround on F18 and higher
+# Use systemctl to launch mdmon on F18 and higher
 %if "%{fedora}" >= "18"
-%patch0 -p1 -b .cgroup
+%patch96 -p1 -b .sysctl
 %endif
 
 %patch1 -p1 -b .raidsize
@@ -77,7 +76,7 @@ is not used as the system init process.
 # Fedora customization patches
 %patch97 -p1 -b .udev
 %patch98 -p1 -b .static
-# Fedora 15, 16, 17 - only
+# Fedora 16, 17 - only
 %if "%{fedora}" <= "17"
 %patch99 -p1 -b .map-dir
 %endif
@@ -100,17 +99,19 @@ mkdir -p -m 700 %{buildroot}/var/run/mdadm
 # systemd
 mkdir -p %{buildroot}%{_unitdir}
 install -m644 %{SOURCE6} %{buildroot}%{_unitdir}
+install -m644 %{SOURCE7} %{buildroot}%{_unitdir}
+install -m644 %{SOURCE8} %{buildroot}%{_unitdir}
 
 # tmpfile
 mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
-install -m 0644 %{SOURCE8} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
+install -m 0644 %{SOURCE9} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
 mkdir -p %{buildroot}%{_localstatedir}/run/
 install -d -m 0710 %{buildroot}%{_localstatedir}/run/%{name}/
 
 # abrt
 %if "%{fedora}" >= "17"
 mkdir -p %{buildroot}/etc/libreport/events.d
-install -m644 %{SOURCE9} %{buildroot}/etc/libreport/events.d
+install -m644 %{SOURCE10} %{buildroot}/etc/libreport/events.d
 %endif
 
 %clean
@@ -144,6 +145,8 @@ rm -rf %{buildroot}
 /sbin/*
 %{_sbindir}/raid-check
 %{_unitdir}/mdmonitor.service
+%{_unitdir}/mdmon-offroot at .service
+%{_unitdir}/mdmon at .service
 %{_mandir}/man*/md*
 %config(noreplace) %{_sysconfdir}/cron.d/*
 %config(noreplace) %{_sysconfdir}/sysconfig/*
@@ -159,6 +162,12 @@ rm -rf %{buildroot}
 %endif
 
 %changelog
+* Mon Jan 21 2013 Jes Sorensen <Jes.Sorensen at redhat.com> - 3.2.6-12
+- Launch mdmon via systemctl to avoid it ending up in the wrong cgroup
+  and getting killed in the boot process when switching from the
+  initrd to the real root.
+- Resolves bz879327
+
 * Tue Jan 8 2013 Jes Sorensen <Jes.Sorensen at redhat.com> - 3.2.6-11
 - Move code to leave udev cgroup into mdmon and excute it after we
   work, to make sure it actually does the right thing.


More information about the scm-commits mailing list