From 438d0fc7116a76b42b59c2a7e56953aa4b55684a Mon Sep 17 00:00:00 2001
From: Marcin Krol <hawk@tld-linux.org>
Date: Thu, 1 May 2014 14:58:53 +0000
Subject: [PATCH] - merged 2.02.106 from PLD

---
 lvm2-pld_init.patch | 41 ++++++++++++++++++++---------------------
 lvm2.spec           | 18 ++++++++++++------
 2 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/lvm2-pld_init.patch b/lvm2-pld_init.patch
index bf1b475..90b549c 100644
--- a/lvm2-pld_init.patch
+++ b/lvm2-pld_init.patch
@@ -104,9 +104,8 @@ diff -dur LVM2.2.02.98.orig/scripts/clvmd_init_red_hat.in LVM2.2.02.98/scripts/c
  
  	# If that fails then do a normal stop & restart
  	if  [ $? != 0 ]; then
-diff -dur LVM2.2.02.98.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.02.98/scripts/lvm2_monitoring_init_red_hat.in
---- LVM2.2.02.98.orig/scripts/lvm2_monitoring_init_red_hat.in	2012-10-15 16:24:58.000000000 +0200
-+++ LVM2.2.02.98/scripts/lvm2_monitoring_init_red_hat.in	2012-10-25 11:57:52.000000000 +0200
+--- LVM2.2.02.106/scripts/lvm2_monitoring_init_red_hat.in.orig	2014-04-10 17:38:46.000000000 +0200
++++ LVM2.2.02.106/scripts/lvm2_monitoring_init_red_hat.in	2014-04-22 21:38:55.153260547 +0200
 @@ -1,4 +1,4 @@
 -#!/bin/bash
 +#!/bin/sh
@@ -120,18 +119,18 @@ diff -dur LVM2.2.02.98.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.02.98
 -	ret=0
 +	local ret=0
  	# TODO do we want to separate out already active groups only?
- 	VGSLIST=`$VGS --noheadings -o name --config 'log{command_names=0 prefix="  "}' 2> /dev/null`
+ 	VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' 2> /dev/null`
  	for vg in $VGSLIST
  	do
--	    action "Starting monitoring for VG $vg:" $VGCHANGE --monitor y --poll y --config 'log{command_names=0 prefix="  "}' $vg || ret=$?
+-	    action "Starting monitoring for VG $vg:" $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' $vg || ret=$?
 +	    msg_starting "Starting monitoring for VG $vg:"; busy
-+		$VGCHANGE --monitor y --poll y --config 'log{command_names=0 prefix="  "}' $vg
-+	   	ret=$?
-+		if [ $ret -ne 0 ]; then
-+			fail
-+			return $ret
-+		fi
-+		ok
++	    $VGCHANGE --monitor y --poll y --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' $vg
++	    ret=$?
++	    if [ $ret -ne 0 ]; then
++		fail
++		return $ret
++	    fi
++	    ok
  	done
  
  	return $ret
@@ -145,18 +144,18 @@ diff -dur LVM2.2.02.98.orig/scripts/lvm2_monitoring_init_red_hat.in LVM2.2.02.98
  	if test "$WARN" = "1"; then
  	   echo "Not stopping monitoring, this is a dangerous operation. Please use force-stop to override."
 @@ -69,7 +76,14 @@
- 	VGSLIST=`$VGS --noheadings -o name --config 'log{command_names=0 prefix="  "}' 2> /dev/null`
+ 	VGSLIST=`$VGS --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' 2> /dev/null`
  	for vg in $VGSLIST
  	do
--	    action "Stopping monitoring for VG $vg:" $VGCHANGE --monitor n --config 'log{command_names=0 prefix="  "}' $vg || ret=$?
+-	    action "Stopping monitoring for VG $vg:" $VGCHANGE --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' $vg || ret=$?
 +	    msg_stopping "Stopping monitoring for VG $vg:"; busy
-+		$VGCHANGE --monitor n --config 'log{command_names=0 prefix="  "}' $vg
-+	   	ret=$?
-+		if [ $ret -ne 0 ]; then
-+			fail
-+			return $ret
-+		fi
-+		ok
++	    $VGCHANGE --monitor n --ignoreskippedcluster --config 'log{command_names=0 prefix="  "}' $vg
++	    ret=$?
++	    if [ $ret -ne 0 ]; then
++		fail
++		return $ret
++	    fi
++	    ok
  	done
  	return $ret
  }
diff --git a/lvm2.spec b/lvm2.spec
index 3e02e44..99442aa 100644
--- a/lvm2.spec
+++ b/lvm2.spec
@@ -33,12 +33,12 @@
 Summary:	The new version of Logical Volume Manager for Linux
 Summary(pl.UTF-8):	Nowa wersja Logical Volume Managera dla Linuksa
 Name:		lvm2
-Version:	2.02.105
+Version:	2.02.106
 Release:	1
 License:	GPL v2 and LGPL v2.1
 Group:		Applications/System
 Source0:	ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
-# Source0-md5:	b5b3540661fc70bf329b526c1cfbcf3a
+# Source0-md5:	77f84279fb649b3dc4edad1c6d1a1b0e
 Source1:	%{name}-tmpfiles.conf
 Source2:	clvmd.service
 Source3:	clvmd.sysconfig
@@ -180,6 +180,7 @@ Summary:	Userspace support for the device-mapper
 Summary(pl.UTF-8):	Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
 Group:		Base
 Requires(post,postun):	/sbin/ldconfig
+Requires(post,preun,postun):	systemd-units >= 38
 Requires:	systemd-units >= 38
 
 %description -n device-mapper
@@ -384,11 +385,11 @@ install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm,/etc/sysconfig}
 	GROUP=""
 
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
 
 %if %{with cluster}
-install %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/clvmd.service
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/clvmd
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/clvmd.service
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/clvmd
 %endif
 
 mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib}
@@ -478,6 +479,7 @@ fi
 %attr(755,root,root) %{_sbindir}/pv*
 %attr(755,root,root) %{_sbindir}/vg*
 %{_mandir}/man5/lvm.conf.5*
+%{_mandir}/man7/lvmthin.7*
 %{_mandir}/man8/blkdeactivate.8*
 %{_mandir}/man8/fsadm.8*
 %{_mandir}/man8/lv*.8*
@@ -514,14 +516,18 @@ fi
 %attr(755,root,root) %{_usrsbindir}/clvmd
 %attr(754,root,root) /etc/rc.d/init.d/clvmd
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clvmd
+%attr(755,root,root) /lib/systemd/lvm2-cluster-activation
 %{systemdunitdir}/clvmd.service
+%{systemdunitdir}/lvm2-cluster-activation.service
+%{systemdunitdir}/lvm2-clvmd.service
 %{_mandir}/man8/clvmd.8*
 
 %files cmirrord
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_usrsbindir}/cmirrord
-%{_mandir}/man8/cmirrord.8*
 %attr(754,root,root) /etc/rc.d/init.d/cmirrord
+%{systemdunitdir}/lvm2-cmirrord.service
+%{_mandir}/man8/cmirrord.8*
 %endif
 
 %files resource-agents
-- 
2.49.0