From aacb875dc205897d71520abc64ca3e85b9fa6bde Mon Sep 17 00:00:00 2001 From: David Teigland Date: Mon, 24 Sep 2012 14:22:55 -0500 Subject: [PATCH 1/2] Update to sanlock-2.5 --- .gitignore | 1 + sanlock.spec | 12 +++++------- sources | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 752fbf1..cd20e8f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /sanlock-2.2.tar.gz /sanlock-2.3.tar.gz /sanlock-2.4.tar.gz +/sanlock-2.5.tar.gz diff --git a/sanlock.spec b/sanlock.spec index 4c73006..41516d3 100644 --- a/sanlock.spec +++ b/sanlock.spec @@ -1,6 +1,6 @@ Name: sanlock -Version: 2.4 -Release: 3%{?dist} +Version: 2.5 +Release: 1%{?dist} Summary: A shared disk lock manager Group: System Environment/Base @@ -13,9 +13,6 @@ Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd Source0: https://fedorahosted.org/releases/s/a/sanlock/%{name}-%{version}.tar.gz -Patch0: 0001-daemon-include-resource.h.patch -Patch1: 0002-daemon-fix-lockfile-ownership.patch - %description sanlock uses disk paxos to manage leases on shared storage. Hosts connected to a common SAN can use this to synchronize their @@ -23,8 +20,6 @@ access to the shared disks. %prep %setup -q -%patch0 -p1 -b .0001-daemon-include-resource.h.patch -%patch1 -p1 -b .0002-daemon-fix-lockfile-ownership.patch %build # upstream does not require configure @@ -185,6 +180,9 @@ developing applications that use %{name}. %{_includedir}/sanlock_direct.h %changelog +* Mon Sep 24 2012 David Teigland - 2.5-1 +- Update to sanlock-2.5 + * Tue Jul 24 2012 David Teigland - 2.4-3 - fix lockfile ownership diff --git a/sources b/sources index 1855327..8a29efe 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5d056f13f1bec99c858867910b557380 sanlock-2.4.tar.gz +d89e5f22f4b2b4c08fcc9af74949647a sanlock-2.5.tar.gz From bceaa980e9840f95d2331a5836ba11a95afea757 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Tue, 9 Oct 2012 11:54:26 -0500 Subject: [PATCH 2/2] update to sanlock-2.6 --- .gitignore | 1 + sanlock.spec | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++- sources | 2 +- 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index cd20e8f..fbebb51 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /sanlock-2.3.tar.gz /sanlock-2.4.tar.gz /sanlock-2.5.tar.gz +/sanlock-2.6.tar.gz diff --git a/sanlock.spec b/sanlock.spec index 41516d3..039a9fd 100644 --- a/sanlock.spec +++ b/sanlock.spec @@ -1,5 +1,5 @@ Name: sanlock -Version: 2.5 +Version: 2.6 Release: 1%{?dist} Summary: A shared disk lock manager @@ -27,6 +27,7 @@ access to the shared disks. CFLAGS=$RPM_OPT_FLAGS make -C wdmd CFLAGS=$RPM_OPT_FLAGS make -C src CFLAGS=$RPM_OPT_FLAGS make -C python +CFLAGS=$RPM_OPT_FLAGS make -C fence_sanlock %install rm -rf $RPM_BUILD_ROOT @@ -39,15 +40,21 @@ make -C wdmd \ make -C python \ install LIBDIR=%{_libdir} \ DESTDIR=$RPM_BUILD_ROOT +make -C fence_sanlock \ + install LIBDIR=%{_libdir} \ + DESTDIR=$RPM_BUILD_ROOT %if 0%{?fedora} >= 16 install -D -m 0755 init.d/sanlock $RPM_BUILD_ROOT/lib/systemd/systemd-sanlock install -D -m 0644 init.d/sanlock.service $RPM_BUILD_ROOT/%{_unitdir}/sanlock.service install -D -m 0755 init.d/wdmd $RPM_BUILD_ROOT/lib/systemd/systemd-wdmd install -D -m 0644 init.d/wdmd.service $RPM_BUILD_ROOT/%{_unitdir}/wdmd.service +install -D -m 0755 init.d/fence_sanlockd $RPM_BUILD_ROOT/lib/systemd/systemd-fence_sanlockd +install -D -m 0644 init.d/fence_sanlockd.service $RPM_BUILD_ROOT/%{_unitdir}/fence_sanlockd.service %else install -D -m 755 init.d/sanlock $RPM_BUILD_ROOT/%{_initddir}/sanlock install -D -m 755 init.d/wdmd $RPM_BUILD_ROOT/%{_initddir}/wdmd +install -D -m 755 init.d/fence_sanlockd $RPM_BUILD_ROOT/%{_initddir}/fence_sanlockd %endif install -Dm 0644 src/logrotate.sanlock \ @@ -56,7 +63,14 @@ install -Dm 0644 src/logrotate.sanlock \ install -Dm 0644 src/sysconfig.sanlock \ $RPM_BUILD_ROOT/etc/sysconfig/sanlock +install -Dm 0644 wdmd/sysconfig.wdmd \ + $RPM_BUILD_ROOT/etc/sysconfig/wdmd + +install -dm 0755 $RPM_BUILD_ROOT/etc/wdmd.d + install -Dd -m 775 $RPM_BUILD_ROOT/%{_localstatedir}/run/sanlock +install -Dd -m 775 $RPM_BUILD_ROOT/%{_localstatedir}/run/fence_sanlock +install -Dd -m 775 $RPM_BUILD_ROOT/%{_localstatedir}/run/fence_sanlockd %clean rm -rf $RPM_BUILD_ROOT @@ -67,6 +81,7 @@ getent group sanlock > /dev/null || /usr/sbin/groupadd \ getent passwd sanlock > /dev/null || /usr/sbin/useradd \ -u 179 -c "sanlock" -s /sbin/nologin -r \ -g 179 -d /var/run/sanlock sanlock +/usr/sbin/usermod -a -G disk sanlock %post if [ $1 -eq 1 ] ; then @@ -122,6 +137,7 @@ fi %{_mandir}/man8/sanlock* %config(noreplace) %{_sysconfdir}/logrotate.d/sanlock %config(noreplace) %{_sysconfdir}/sysconfig/sanlock +%config(noreplace) %{_sysconfdir}/sysconfig/wdmd %package lib Summary: A shared disk lock manager library @@ -179,7 +195,63 @@ developing applications that use %{name}. %{_includedir}/sanlock_resource.h %{_includedir}/sanlock_direct.h +%package -n fence-sanlock +Summary: Fence agent using sanlock and wdmd +Group: System Environment/Base +Requires: sanlock = %{version}-%{release} + +%description -n fence-sanlock +The fence-sanlock package contains the fence agent and +daemon for using sanlock and wdmd as a cluster fence agent. + +%files -n fence-sanlock +%defattr(-,root,root,-) +%if 0%{?fedora} >= 16 +/lib/systemd/systemd-fence_sanlockd +%{_unitdir}/fence_sanlockd.service +%else +%{_initddir}/fence_sanlockd +%endif +%{_sbindir}/fence_sanlock +%{_sbindir}/fence_sanlockd +%dir /etc/wdmd.d +%dir %attr(-,root,root) %{_localstatedir}/run/fence_sanlock +%dir %attr(-,root,root) %{_localstatedir}/run/fence_sanlockd +%{_mandir}/man8/fence_sanlock* + +%post -n fence-sanlock +if [ $1 -eq 1 ] ; then +%if 0%{?fedora} >= 16 + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%else + /sbin/chkconfig --add fence_sanlockd +%endif +ccs_update_schema > /dev/null 2>&1 ||: +fi + +%preun -n fence-sanlock +if [ $1 = 0 ]; then +%if 0%{?fedora} >= 16 + /bin/systemctl --no-reload fence_sanlockd.service > /dev/null 2>&1 || : +%else + /sbin/service fence_sanlockd stop > /dev/null 2>&1 + /sbin/chkconfig --del fence_sanlockd +%endif +fi + +%postun -n fence-sanlock +if [ $1 -ge 1 ] ; then +%if 0%{?fedora} >= 16 + /bin/systemctl try-restart fence_sanlockd.service > /dev/null 2>&1 || : +%else + /sbin/service fence_sanlockd condrestart >/dev/null 2>&1 || : +%endif +fi + %changelog +* Tue Oct 09 2012 David Teigland - 2.6-1 +- Update to sanlock-2.6 + * Mon Sep 24 2012 David Teigland - 2.5-1 - Update to sanlock-2.5 diff --git a/sources b/sources index 8a29efe..b6d8e07 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d89e5f22f4b2b4c08fcc9af74949647a sanlock-2.5.tar.gz +c488b1914e0996246e3572a359093d7d sanlock-2.6.tar.gz