Blame SOURCES/mdadm-3.2.6-mdmon-.service-Change-type-of-process-start-up-to-fo.patch

8c8931
From 2167de78aab599e7a7a8d057ef04bf18527bc129 Mon Sep 17 00:00:00 2001
8c8931
From: Pawel Baldysiak <pawel.baldysiak@intel.com>
8c8931
Date: Thu, 6 Mar 2014 15:51:44 +0100
8c8931
Subject: [PATCH] mdmon@.service: Change type of process start-up to 'forking'.
8c8931
8c8931
Mdadm does not wait enough time when mdmon is started by systemd.
8c8931
It causes various problems with behaviour of a RAID volume with external metadata.
8c8931
For example: mdmon does not update a value of checkpoint during migration
8c8931
and second RAID5 volume is read-only after reboot done during
8c8931
container reshape (both problems occur with IMSM matadata).
8c8931
If a type of process start-up is changed to 'forking', systemctl will
8c8931
wait until mdmon (parent) process exits after calling fork.
8c8931
This way mdmon will always be fully initialized after start_mdmon
8c8931
and these problems will not occur.
8c8931
In this case it is recommended to add a path to PIDFile, so that systemd
8c8931
does not have to guess a PID of the mdmon process.
8c8931
8c8931
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
8c8931
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
8c8931
Reviewed-by: Lukasz Dorau <lukasz.dorau@intel.com>
8c8931
Signed-off-by: NeilBrown <neilb@suse.de>
8c8931
---
8c8931
 systemd/mdmon@.service | 4 +++-
8c8931
 1 file changed, 3 insertions(+), 1 deletion(-)
8c8931
8c8931
diff --git a/systemd/mdmon@.service b/systemd/mdmon@.service
8c8931
index 5520cd0..304b26e 100644
8c8931
--- a/systemd/mdmon@.service
8c8931
+++ b/systemd/mdmon@.service
8c8931
@@ -11,7 +11,10 @@
8c8931
 Before=initrd-switch-root.target
8c8931
 
8c8931
 [Service]
8c8931
-ExecStart=/sbin/mdmon --foreground %I
8c8931
+Environment=IMSM_NO_PLATFORM=1
8c8931
+ExecStart=/sbin/mdmon %I
8c8931
+Type=forking
8c8931
+PIDFile=/run/mdadm/%I.pid
8c8931
 StandardInput=null
8c8931
 StandardOutput=null
8c8931
 StandardError=null