Hello community,

here is the log from the commit of package resource-agents for openSUSE:Factory 
checked in at 2016-07-07 15:08:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/resource-agents (Old)
 and      /work/SRC/openSUSE:Factory/.resource-agents.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "resource-agents"

Changes:
--------
--- /work/SRC/openSUSE:Factory/resource-agents/resource-agents.changes  
2016-06-05 14:19:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.resource-agents.new/resource-agents.changes     
2016-07-07 15:08:39.000000000 +0200
@@ -1,0 +2,15 @@
+Thu Jun 30 09:58:40 UTC 2016 - tchva...@suse.com
+
+- Remove unused conditions from the spec-file as we build only on
+  new enough distributions
+- Sort all variables with spec-cleaner for better readability
+- Enable monitoring subpkg as we now have all the needed dependencies
+- Convert to pkgconfig style dependencies where applicable
+
+-------------------------------------------------------------------
+Tue Jun 28 15:54:26 UTC 2016 - kgronl...@suse.com
+
+- exportfs: Add pseudo resource factor (bsc#978680)
+- Add 0001-exportfs-Add-pseudo-resource-factor-bsc-978680.patch
+
+-------------------------------------------------------------------

New:
----
  0001-exportfs-Add-pseudo-resource-factor-bsc-978680.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ resource-agents.spec ++++++
--- /var/tmp/diff_new_pack.RbvLRM/_old  2016-07-07 15:08:40.000000000 +0200
+++ /var/tmp/diff_new_pack.RbvLRM/_new  2016-07-07 15:08:40.000000000 +0200
@@ -16,40 +16,12 @@
 #
 
 
-%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
-%global agents_docdir %{_defaultdocdir}/%{name}-%{version}
-%endif
-%if 0%{?suse_version}
-%global agents_docdir %{_defaultdocdir}/%{name}
-%endif
-#
-# Since this spec file supports multiple distributions, ensure we
-# use the correct group for each.
-#
-%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
-%define pkg_group System Environment/Daemons
-%else
-%define pkg_group Productivity/Clustering/HA
-%endif
-%define SSLeay                 perl-Net-SSLeay
-%if 0%{?suse_version} < 1100
-%define SSLeay                 perl-Net_SSLeay
-%endif
-
-%if ! %{defined _rundir}
-%define _rundir %{_localstatedir}/run
-%endif
-
-# Disabled by default since openSUSE:Factory
-# lacks monitoring-plugins
-%define with_monitoring 0
-
 Name:           resource-agents
+Version:        3.9.7+git.1461938976.cb7c36a
+Release:        0
 Summary:        Open Source HA Reusable Cluster Resource Scripts
 License:        GPL-2.0 and LGPL-2.1+ and GPL-3.0+
 Group:          Productivity/Clustering/HA
-Version:        3.9.7+git.1461938976.cb7c36a
-Release:        0
 Url:            http://linux-ha.org/
 Source:         resource-agents-%{version}.tar.xz
 Source1:        resource-agents.conf
@@ -66,33 +38,22 @@
 Patch9:         0001-Medium-ldirectord-Remove-IPv6-workaround-bsc-977193.patch
 # PATCH-FIX-OPENSUSE: Medium: CTDB: Use --logging syntax for ctdbd (bsc#981863)
 Patch10:        0001-Medium-CTDB-Use-logging-syntax-for-ctdbd-bsc-981863.patch
-
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Obsoletes:      heartbeat-resources
-Provides:       heartbeat-resources
+# PATCH-FIX-UPSTREAM: exportfs: Add pseudo resource factor (bsc#978680)
+Patch11:        0001-exportfs-Add-pseudo-resource-factor-bsc-978680.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
-BuildRequires:  glib2-devel
-BuildRequires:  pkgconfig
-BuildRequires:  python-devel
-%if 0%{?suse_version}
-BuildRequires:  libglue-devel
-%if %suse_version > 1130
-BuildRequires:  libnet-devel
-%else
-BuildRequires:  libnet
-%endif
 BuildRequires:  docbook-xsl-stylesheets
 BuildRequires:  docbook_4
+BuildRequires:  libglue-devel
+BuildRequires:  libnet-devel
 BuildRequires:  libxslt
-%endif
-%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
-BuildRequires:  cluster-glue-libs-devel
-BuildRequires:  docbook-dtds
-BuildRequires:  docbook-style-xsl
-BuildRequires:  libxslt
-BuildRequires:  which
-%endif
+BuildRequires:  pkgconfig
+BuildRequires:  systemd-rpm-macros
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(python)
+Obsoletes:      heartbeat-resources
+Provides:       heartbeat-resources
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
 A set of scripts to interface with several services to operate in a
@@ -103,31 +64,19 @@
 Summary:        A Monitoring Daemon for Maintaining High Availability Resources
 License:        GPL-2.0 and LGPL-2.1+
 Group:          Productivity/Clustering/HA
-Requires:       %{SSLeay}
 Requires:       %{name}
 Requires:       ipvsadm
-Requires:       perl-libwww-perl
-Obsoletes:      heartbeat-ldirectord
-Provides:       heartbeat-ldirectord
+Requires:       logrotate
 Requires:       perl-IO-Socket-INET6
 Requires:       perl-MailTools
+Requires:       perl-Net-SSLeay
 Requires:       perl-Socket6
-%if 0%{?suse_version}
-Requires:       logrotate
-%endif
-%if 0%{?fedora_version}
-Requires(post): /sbin/chkconfig
-Requires(preun):/sbin/chkconfig
-%endif
-%if %{defined systemd_requires}
-BuildRequires:  systemd
+Requires:       perl-libwww-perl
+Obsoletes:      heartbeat-ldirectord
+Provides:       heartbeat-ldirectord
 %{?systemd_requires}
-%endif
 
 %description -n ldirectord
-The Linux Director Daemon (ldirectord) was written by Jacob Rief.
-<jacob.r...@tiscover.com>
-
 ldirectord is a stand alone daemon for monitoring the services on real
 servers. Currently, HTTP, HTTPS, and FTP services are supported.
 ldirectord is simple to install and works with the heartbeat code
@@ -135,13 +84,10 @@
 
 See 'ldirectord -h' and linux-ha/doc/ldirectord for more information.
 
-%if %{with_monitoring}
-
 %package -n monitoring-plugins-metadata
 Summary:        Metadata for Monitoring plugins
 License:        LGPL-2.1+ and GPL-2.0+
 Group:          Productivity/Clustering/HA
-Provides:       nagios-plugins-metadata
 Requires:       monitoring-plugins-fping
 Requires:       monitoring-plugins-http
 Requires:       monitoring-plugins-ldap
@@ -149,142 +95,82 @@
 Requires:       monitoring-plugins-pgsql
 Requires:       monitoring-plugins-tcp
 Requires:       resource-agents
-#BuildArch:      noarch
+Provides:       nagios-plugins-metadata
+BuildArch:      noarch
 
 %description -n monitoring-plugins-metadata
 XML files containing metadata which facilitates using nagios
 plugins as resource agents. These files were produced from help
 pages of individual nagios plugins.
 
-%endif
-
 %prep
 %autosetup -p1
 
 %build
-CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
-export CFLAGS
-%if %{defined _unitdir}
-CONF_OPTS="--with-ras-set=linux-ha \
-    --enable-fatal-warnings=yes \
-    --with-systemdsystemunitdir=%{_unitdir} \
-    --with-pkg-name=%{name} \
-    --with-rsctmpdir=%{_rundir}/%{name}"
-%else
-CONF_OPTS="--with-ras-set=linux-ha \
-    --enable-fatal-warnings=yes \
-    --with-pkg-name=%{name}"
-%endif
-./autogen.sh
+autoreconf -fvi
 #because quilt push changed the permissions of  sg_persist.
 chmod 775 heartbeat/sg_persist
-%if 0%{?suse_version} >= 1020 || 0%{?fedora} >= 11 || 0%{?centos_version} > 5 
|| 0%{?rhel} > 5
-%configure $CONF_OPTS \
-    --docdir=%{agents_docdir}
-%else
-export docdir=%{agents_docdir}
-%configure $CONF_OPTS
-%endif
-export MAKE="make %{?jobs:-j%jobs}"
-make %{?jobs:-j%jobs}
+%configure \
+    --docdir=%{_defaultdocdir}/%{name} \
+    --with-ras-set=linux-ha \
+    --enable-fatal-warnings=no \
+    --with-systemdsystemunitdir=%{_unitdir} \ \
+    --with-pkg-name=%{name} \
+    --with-rsctmpdir=%{_rundir}/%{name}
+make %{?_smp_mflags}
 
 %install
-make DESTDIR=$RPM_BUILD_ROOT install
-(
-  mkdir -p $RPM_BUILD_ROOT/etc/ha.d/resource.d
-  ln -s %{_sbindir}/ldirectord $RPM_BUILD_ROOT/etc/ha.d/resource.d/ldirectord
-) || true
-test -d $RPM_BUILD_ROOT/sbin || mkdir $RPM_BUILD_ROOT/sbin
-(
-  cd $RPM_BUILD_ROOT/sbin
-%if %{defined _unitdir}
-  ln -s /usr/sbin/service rcldirectord
-%else
-  ln -sf /etc/init.d/ldirectord rcldirectord
-%endif
-) || true
+%make_install
+mkdir -p %{buildroot}%{_sysconfdir}/ha.d/resource.d
+ln -s service %{buildroot}/%{_sbindir}/rcldirectord
 # Dont package static libs or compiled python
-find $RPM_BUILD_ROOT -name '*.a' -type f -print0 | xargs -0 rm -f
-find $RPM_BUILD_ROOT -name '*.la' -type f -print0 | xargs -0 rm -f
-find $RPM_BUILD_ROOT -name '*.pyc' -type f -print0 | xargs -0 rm -f
-find $RPM_BUILD_ROOT -name '*.pyo' -type f -print0 | xargs -0 rm -f
+find %{buildroot} -type f -name "*.la" -delete -print
+find %{buildroot} -name '*.pyc' -type f -print0 | xargs -0 rm -f
+find %{buildroot} -name '*.pyo' -type f -print0 | xargs -0 rm -f
 # Unset execute permissions from things that shouln't have it
-find $RPM_BUILD_ROOT -name 'ocf-*'  -type f -print0 | xargs -0 chmod a-x
-find $RPM_BUILD_ROOT -name '*.dtd'  -type f -print0 | xargs -0 chmod a-x
-chmod 0755 $RPM_BUILD_ROOT/usr/sbin/ocf-tester
-chmod 0755 $RPM_BUILD_ROOT/usr/sbin/ocft
-mkdir -p $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
-install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
+find %{buildroot} -name 'ocf-*'  -type f -print0 | xargs -0 chmod a-x
+find %{buildroot} -name '*.dtd'  -type f -print0 | xargs -0 chmod a-x
+chmod 0755 %{buildroot}%{_sbindir}/ocf-tester
+chmod 0755 %{buildroot}%{_sbindir}/ocft
+mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
+install -m 644 %{SOURCE1} %{buildroot}%{_prefix}/lib/tmpfiles.d
 (
-cd $RPM_BUILD_ROOT/%{_libdir}/heartbeat
+cd %{buildroot}/%{_libdir}/heartbeat
 for f in ocf-returncodes ocf-shellfuncs
 do
-    ln -s /usr/lib/ocf/lib/heartbeat/$f
+    ln -s %{_libexecdir}/ocf/lib/heartbeat/$f
 done
 )
 
-%if %{with_monitoring}
 # install nagios plugins XML metadata
 tar -xjf %{SOURCE2}
 mkdir -p %{buildroot}%{_datadir}/nagios/plugins-metadata
 for file in $(find plugins-metadata -type f); do
        install -m 644 $file %{buildroot}%{_datadir}/nagios/plugins-metadata
 done
-%endif
 
 %post
-if [ -x /usr/bin/systemd-tmpfiles ]; then
-       systemd-tmpfiles --create resource-agents.conf || :
-fi
-test -d %{_rundir}/resource-agents || mkdir -m 1755 %{_rundir}/resource-agents
-
-%if 0%{?suse_version}
+systemd-tmpfiles --create resource-agents.conf || :
 
 %preun -n ldirectord
-%if %{defined _unitdir}
 %service_del_preun ldirectord.service
-%else
-%stop_on_removal ldirectord
-%endif
 
 %postun -n ldirectord
-%if %{defined _unitdir}
 %service_del_postun ldirectord.service
-%else
-%insserv_cleanup
-%endif
 
 %post -n ldirectord
-%if %{defined _unitdir}
 %service_add_post ldirectord.service
-%endif
 
 %pre -n ldirectord
-%if %{defined _unitdir}
 %service_add_pre ldirectord.service
-%endif
-
-%endif
-
-%if 0%{?fedora}
-
-%preun -n ldirectord
-/sbin/chkconfig --del ldirectord
-
-%postun -n ldirectord -p /sbin/ldconfig
-
-%post -n ldirectord
-/sbin/chkconfig --add ldirectord
-
-%endif
 
 %files
 %defattr(-,root,root)
-%dir /usr/lib/ocf
-%dir /usr/lib/ocf/resource.d
-%dir /usr/lib/ocf/lib
-%dir /usr/lib/tmpfiles.d
-/usr/lib/tmpfiles.d/resource-agents.conf
+%dir %{_prefix}/lib/ocf
+%dir %{_prefix}/lib/ocf/resource.d
+%dir %{_prefix}/lib/ocf/lib
+%dir %{_prefix}/lib/tmpfiles.d
+%{_libexecdir}/tmpfiles.d/resource-agents.conf
 %dir %{_datadir}/%{name}
 %dir %{_datadir}/%{name}/ocft
 %dir %{_datadir}/%{name}/ocft/configs
@@ -295,8 +181,8 @@
 %{_datadir}/%{name}/ocft/helpers.sh
 %{_datadir}/%{name}/ocft/runocft
 %{_datadir}/%{name}/ocft/runocft.prereq
-/usr/lib/ocf/resource.d/heartbeat
-/usr/lib/ocf/lib/heartbeat
+%{_libexecdir}/ocf/resource.d/heartbeat
+%{_libexecdir}/ocf/lib/heartbeat
 %{_sbindir}/ocf-tester
 %{_sbindir}/ocft
 %{_sbindir}/sfex_init
@@ -308,13 +194,13 @@
 %doc COPYING.LGPL
 %doc COPYING.GPLv3
 %doc %{_datadir}/%{name}/ra-api-1.dtd
-%doc %{_mandir}/man7/*.7*
-%doc %{_mandir}/man8/ocf-tester.8*
-%doc %{_mandir}/man8/sfex_init.8*
+%{_mandir}/man7/*.7*
+%{_mandir}/man8/ocf-tester.8*
+%{_mandir}/man8/sfex_init.8*
 %doc doc/README.webapps
 # For compatability with pre-existing agents
-%dir /etc/ha.d
-/etc/ha.d/shellfuncs
+%dir %{_sysconfdir}/ha.d
+%{_sysconfdir}/ha.d/shellfuncs
 %dir %{_libdir}/heartbeat
 %{_libdir}/heartbeat/ocf-shellfuncs
 %{_libdir}/heartbeat/ocf-returncodes
@@ -327,27 +213,19 @@
 %files -n ldirectord
 %defattr(-,root,root)
 %doc ldirectord/ldirectord.cf
-%doc %{_mandir}/man8/ldirectord.8*
-%dir /etc/ha.d/resource.d
-#%doc %{_mandir}/man8/supervise-ldirectord-config.8*
+%{_mandir}/man8/ldirectord.8*
+%dir %{_sysconfdir}/ha.d/resource.d
 %{_sbindir}/ldirectord
-/sbin/rcldirectord
-%if %{defined _unitdir}
+%{_sbindir}/rcldirectord
 %{_unitdir}/ldirectord.service
 %exclude %{_sysconfdir}/init.d/ldirectord
-%else
-%{_sysconfdir}/init.d/ldirectord
-%endif
-#%{_sbindir}/supervise-ldirectord-config
 %{_sysconfdir}/ha.d/resource.d/ldirectord
 %config(noreplace) %{_sysconfdir}/logrotate.d/ldirectord
 
-%if %{with_monitoring}
 %files -n monitoring-plugins-metadata
 %defattr(-,root,root)
 %dir %{_datadir}/nagios
 %dir %{_datadir}/nagios/plugins-metadata
 %attr(0644,root,root) %{_datadir}/nagios/plugins-metadata/*
-%endif
 
 %changelog

++++++ 0001-exportfs-Add-pseudo-resource-factor-bsc-978680.patch ++++++
commit 372a6931eef9f9725166d96e314b2e2f5312fd1e
Author: Michal Koutný <mkou...@suse.com>
Date:   Fri Jun 3 16:48:02 2016 +0200

    exportfs: Add pseudo resource factor (bsc#978680)
    
    exportfs resource relies on output from exportfs utility which in turn
    stores its state data in /var/lib/nfs/etab. This file survives reboot
    (e.g. after fencing) and when probe monitor operation is invoked
    exportfs RA will report resource as *started* if there are respective
    records in /var/lib/nfs/etab despite the fact nfsserver resource is
    not started and exportfs resource is thus effectively *stopped*.
    
    Normally this is not a problem because nfsserver clears content of
    /var/lib/nfs/etab upon start, however, when only monitor operations are
    executed (e.g. probing after reboot) wrong state of exportfs resource is
    reported.
    
    This solution puts alleged status of the resource in logical conjunction
    with pseudo resource state (i.e. it's not pure pseudo resource, just
    necessary condition). The idea is from Dejan Muhamedagic
    <dmuhameda...@suse.com>.
    
    Note: pseudo resource state is kept in $HA_RSCTMP directory, which is
    supposed to be empty after reboot.

diff --git a/heartbeat/exportfs b/heartbeat/exportfs
index 4b88fa1..bf4191e 100755
--- a/heartbeat/exportfs
+++ b/heartbeat/exportfs
@@ -266,6 +266,10 @@ is_exported() {
 
 exportfs_monitor ()
 {
+       if ! ha_pseudo_resource "${OCF_RESOURCE_INSTANCE}" monitor; then
+               return $OCF_NOT_RUNNING
+       fi
+
        if forall is_exported "${OCF_RESKEY_clientspec}"; then
                if [ ${OCF_RESKEY_rmtab_backup} != "none" ]; then
                        forall backup_rmtab
@@ -311,6 +315,8 @@ exportfs_start ()
                return $OCF_SUCCESS
        fi
        ocf_log info "Exporting file system(s) ..."
+
+       ha_pseudo_resource "${OCF_RESOURCE_INSTANCE}" start
        forall export_one
 
        # Restore the rmtab to ensure smooth NFS-over-TCP failover
@@ -391,6 +397,8 @@ exportfs_stop ()
 
        if [ $rc -eq 0 ]; then
                cleanup_export_cache
+               ha_pseudo_resource "${OCF_RESOURCE_INSTANCE}" stop
+
                ocf_log info "Un-exported file system(s)"
                return $OCF_SUCCESS
        else

Reply via email to