[lvm2] Prepare hooks for lvmetad support.

Peter Rajnoha prajnoha at fedoraproject.org
Mon Mar 5 15:37:27 UTC 2012


commit b77e7d04ef7d9988d9ba5dbdf46a94a2747afca3
Author: Peter Rajnoha <prajnoha at redhat.com>
Date:   Mon Mar 5 16:36:26 2012 +0100

    Prepare hooks for lvmetad support.

 lvm2.spec |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/lvm2.spec b/lvm2.spec
index 4b93e0a..4b17b90 100644
--- a/lvm2.spec
+++ b/lvm2.spec
@@ -5,6 +5,7 @@
 %define enable_openais 1
 %define enable_cmirror 1
 %define enable_udev 1
+%define enable_lvmetad 0
 
 %if "%{fedora}" == "12"
 %define enable_systemd 0
@@ -132,7 +133,11 @@ or more physical volumes and creating one or more logical volumes
 %define configure_thin --with-thin=internal
 %endif
 
-%configure --enable-lvm1_fallback --enable-fsadm --with-pool=internal --with-user= --with-group= --with-usrlibdir=/usr/%{_lib} --with-usrsbindir=/usr/sbin --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd %{configure_cluster} %{configure_cmirror} %{?configure_udev} %{?configure_default_data_alignment} %{?configure_thin}
+%if %{enable_lvmetad}
+%define configure_lvmetad --enable-lvmetad
+%endif
+
+%configure --enable-lvm1_fallback --enable-fsadm --with-pool=internal --with-user= --with-group= --with-usrlibdir=/usr/%{_lib} --with-usrsbindir=/usr/sbin --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd %{configure_cluster} %{configure_cmirror} %{?configure_udev} %{?configure_default_data_alignment} %{?configure_thin} %{?configure_lvmetad}
 
 make %{?_smp_mflags}
 
@@ -153,8 +158,14 @@ rm -rf $RPM_BUILD_ROOT
 %if %{enable_systemd}
 /bin/systemctl daemon-reload > /dev/null 2>&1 || :
 /bin/systemctl enable lvm2-monitor.service > /dev/null 2>&1 || :
+%if %{enable_lvmetad}
+/bin/systemctl enable lvm2-lvmetad.socket > /dev/null 2>&1 || :
+%endif
 %else
 /sbin/chkconfig --add lvm2-monitor
+%if %{enable_lvmetad}
+/sbin/chkconfig --add lvm2-lvmetad
+%endif
 %endif
 
 %preun
@@ -162,10 +173,17 @@ rm -rf $RPM_BUILD_ROOT
 if [ "$1" = 0 ]; then
 	/bin/systemctl --no-reload disable lvm2-monitor.service > /dev/null 2>&1 || :
 	/bin/systemctl stop lvm2-monitor.service > /dev/null 2>&1 || :
+	%if %{enable_lvmetad}
+	/bin/systemctl --no-reload disable lvm2-lvmetad.socket > /dev/null 2>&1 || :
+	/bin/systemctl stop lvm2-lvmetad.service lvm2-lvmetad.socket > /dev/null 2>&1 || :
+	%endif
 fi
 %else
 if [ "$1" = 0 ]; then
 	/sbin/chkconfig --del lvm2-monitor
+	%if %{enable_lvmetad}
+	/sbin/chkconfig --del lvm2-lvmetad
+	%endif
 fi
 %endif
 
@@ -174,6 +192,9 @@ fi
 /bin/systemctl daemon-reload > /dev/null 2>&1 || :
 if [ $1 -ge 1 ]; then
 	/bin/systemctl try-restart lvm2-monitor.service > /dev/null 2>&1 || :
+	%if %{enable_lvmetad}
+	/bin/systemctl try-restart lvm2-lvmetad.service > /dev/null 2>&1 || :
+	%endif
 fi
 %endif
 
@@ -234,6 +255,9 @@ fi
 %{_sbindir}/vgscan
 %{_sbindir}/vgsplit
 %{_sbindir}/lvmconf
+%if %{enable_lvmetad}
+%{_sbindir}/lvmetad
+%endif
 %{_mandir}/man5/lvm.conf.5.gz
 %{_mandir}/man8/fsadm.8.gz
 %{_mandir}/man8/lvchange.8.gz
@@ -284,6 +308,9 @@ fi
 %{_mandir}/man8/vgsplit.8.gz
 %if %{enable_udev}
 %{_udevdir}/11-dm-lvm.rules
+%if %{enable_lvmetad}
+%{_udevdir}/69-dm-lvm-metad.rules
+%endif
 %endif
 %dir %{_sysconfdir}/lvm
 %ghost %{_sysconfdir}/lvm/cache/.cache
@@ -296,8 +323,15 @@ fi
 %if %{enable_systemd}
 %config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
 %{_unitdir}/lvm2-monitor.service
+%if %{enable_lvmetad}
+%{_unitdir}/lvm2-lvmetad.socket
+%{_unitdir}/lvm2-lvmetad.service
+%endif
 %else
 %{_sysconfdir}/rc.d/init.d/lvm2-monitor
+%if %{enable_lvmetad}
+%{_sysconfdir}/rc.d/init.d/lvm2-lvmetad
+%endif
 %endif
 
 ##############################################################################
@@ -454,6 +488,9 @@ is not used as the system init process.
 
 %files sysvinit
 %{_sysconfdir}/rc.d/init.d/lvm2-monitor
+%if %{enable_lvmetad}
+%{_sysconfdir}/rc.d/init.d/lvm2-lvmetad
+%endif
 
 %endif
 


More information about the scm-commits mailing list