6f8c14
#
6f8c14
# spec file for package sbd
6f8c14
#
6f8c14
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
6f8c14
# Copyright (c) 2013 Lars Marowsky-Bree
6f8c14
#
6f8c14
# All modifications and additions to the file contributed by third parties
6f8c14
# remain the property of their copyright owners, unless otherwise agreed
6f8c14
# upon. The license for this file, and modifications and additions to the
6f8c14
# file, is the same license as for the pristine package itself (unless the
6f8c14
# license for the pristine package is not an Open Source License, in which
6f8c14
# case the license is the MIT License). An "Open Source License" is a
6f8c14
# license that conforms to the Open Source Definition (Version 1.9)
6f8c14
# published by the Open Source Initiative.
6f8c14
6f8c14
# Please submit bugfixes or comments via http://bugs.opensuse.org/
6f8c14
#
d3a775
%global longcommit 6bb085f5704dd4c3841c79504f2aed2228e6d76a
08d4e6
%global shortcommit %(echo %{longcommit}|cut -c1-8)
08d4e6
%global modified %(echo %{longcommit}-|cut -f2 -d-)
6f8c14
%global github_owner Clusterlabs
30bbda
%global buildnum 2
cfb415
cfb415
%ifarch s390x s390
cfb415
# minimum timeout on LPAR diag288 watchdog is 15s
cfb415
%global watchdog_timeout_default 15
cfb415
%else
cfb415
%global watchdog_timeout_default 5
cfb415
%endif
cfb415
08d4e6
# Be careful with sync_resource_startup_default
08d4e6
# being enabled. This configuration has
08d4e6
# to be in sync with configuration in pacemaker
08d4e6
# where it is called sbd_sync - assure by e.g.
08d4e6
# mutual rpm dependencies.
08d4e6
%bcond_without sync_resource_startup_default
08d4e6
# Syncing enabled per default will lead to
08d4e6
# syncing enabled on upgrade without adaption
08d4e6
# of the config.
08d4e6
# Setting can still be overruled via sysconfig.
08d4e6
# The setting in the config-template packaged
08d4e6
# will follow the default if below is is left
08d4e6
# empty. But it is possible to have the setting
08d4e6
# in the config-template deviate from the default
08d4e6
# by setting below to an explicit 'yes' or 'no'.
08d4e6
%global sync_resource_startup_sysconfig ""
6f8c14
6f8c14
Name:           sbd
6f8c14
Summary:        Storage-based death
6f8c14
License:        GPLv2+
6f8c14
Group:          System Environment/Daemons
d3a775
Version:        1.5.1
29e83d
Release:        %{buildnum}%{?dist}
6f8c14
Url:            https://github.com/%{github_owner}/%{name}
08d4e6
Source0:        https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz
30bbda
Patch0:         0001-Fix-Be-a-bit-more-descriptive-on-issues-opening-watc.patch
6f8c14
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
6f8c14
BuildRequires:  autoconf
6f8c14
BuildRequires:  automake
6f8c14
BuildRequires:  libuuid-devel
6f8c14
BuildRequires:  glib2-devel
6f8c14
BuildRequires:  libaio-devel
f975ad
BuildRequires:  corosync-devel
6f8c14
BuildRequires:  pacemaker-libs-devel > 1.1.12
6f8c14
BuildRequires:  libtool
6f8c14
BuildRequires:  libuuid-devel
6f8c14
BuildRequires:  libxml2-devel
6f8c14
BuildRequires:  pkgconfig
6f8c14
BuildRequires:  systemd
f975ad
BuildRequires:  make
f975ad
Conflicts:      fence-agents-sbd < 4.2.1-38
cfb415
Conflicts:      pacemaker-libs < 2.0.5-4
6f8c14
6f8c14
%if 0%{?rhel} > 0
bf8527
ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
6f8c14
%endif
6f8c14
6f8c14
%if %{defined systemd_requires}
6f8c14
%systemd_requires
6f8c14
%endif
6f8c14
6f8c14
%description
6f8c14
6f8c14
This package contains the storage-based death functionality.
6f8c14
08d4e6
Available rpmbuild rebuild options:
08d4e6
  --with(out) : sync_resource_startup_default
08d4e6
f975ad
%package tests
f975ad
Summary:        Storage-based death environment for regression tests
f975ad
License:        GPLv2+
f975ad
Group:          System Environment/Daemons
f975ad
f975ad
%description tests
f975ad
This package provides an environment + testscripts for
f975ad
regression-testing sbd.
f975ad
6f8c14
###########################################################
6f8c14
6f8c14
%prep
08d4e6
%autosetup -n %{name}-%{longcommit} -p1
6f8c14
6f8c14
###########################################################
6f8c14
6f8c14
%build
f975ad
./autogen.sh
6f8c14
export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
cfb415
%configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \
08d4e6
           --with-sync-resource-startup-default=%{?with_sync_resource_startup_default:yes}%{!?with_sync_resource_startup_default:no} \
d3a775
           --with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig} \
d3a775
           --with-runstatedir=%{_rundir}
6f8c14
make %{?_smp_mflags}
6f8c14
6f8c14
###########################################################
6f8c14
6f8c14
%install
6f8c14
6f8c14
make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
6f8c14
rm -rf ${RPM_BUILD_ROOT}%{_libdir}/stonith
6f8c14
f975ad
install -D -m 0755 tests/regressions.sh $RPM_BUILD_ROOT/usr/share/sbd/regressions.sh
6f8c14
%if %{defined _unitdir}
6f8c14
install -D -m 0644 src/sbd.service $RPM_BUILD_ROOT/%{_unitdir}/sbd.service
6f8c14
install -D -m 0644 src/sbd_remote.service $RPM_BUILD_ROOT/%{_unitdir}/sbd_remote.service
6f8c14
%endif
6f8c14
6f8c14
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
6f8c14
install -m 644 src/sbd.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/sbd
6f8c14
f975ad
# Don't package static libs
f975ad
find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
f975ad
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
f975ad
6f8c14
###########################################################
6f8c14
6f8c14
%clean
6f8c14
rm -rf %{buildroot}
6f8c14
6f8c14
%if %{defined _unitdir}
6f8c14
%post
6f8c14
%systemd_post sbd.service
6f8c14
%systemd_post sbd_remote.service
6f8c14
if [ $1 -ne 1 ] ; then
6f8c14
	if systemctl --quiet is-enabled sbd.service 2>/dev/null
6f8c14
	then
6f8c14
		systemctl --quiet reenable sbd.service 2>/dev/null || :
6f8c14
	fi
6f8c14
	if systemctl --quiet is-enabled sbd_remote.service 2>/dev/null
6f8c14
	then
6f8c14
		systemctl --quiet reenable sbd_remote.service 2>/dev/null || :
6f8c14
	fi
6f8c14
fi
6f8c14
6f8c14
%preun
6f8c14
%systemd_preun sbd.service
6f8c14
%systemd_preun sbd_remote.service
6f8c14
6f8c14
%postun
6f8c14
%systemd_postun sbd.service
6f8c14
%systemd_postun sbd_remote.service
6f8c14
%endif
6f8c14
6f8c14
%files
6f8c14
###########################################################
6f8c14
%defattr(-,root,root)
6f8c14
%config(noreplace) %{_sysconfdir}/sysconfig/sbd
6f8c14
%{_sbindir}/sbd
cfb415
%{_datadir}/sbd
cfb415
%{_datadir}/pkgconfig/sbd.pc
f975ad
%exclude %{_datadir}/sbd/regressions.sh
6f8c14
%doc %{_mandir}/man8/sbd*
6f8c14
%if %{defined _unitdir}
6f8c14
%{_unitdir}/sbd.service
6f8c14
%{_unitdir}/sbd_remote.service
6f8c14
%endif
6f8c14
%doc COPYING
6f8c14
f975ad
%files tests
f975ad
###########################################################
f975ad
%defattr(-,root,root)
f975ad
%dir %{_datadir}/sbd
f975ad
%{_datadir}/sbd/regressions.sh
f975ad
%{_libdir}/libsbdtestbed*
f975ad
6f8c14
%changelog
30bbda
* Fri Jul 15 2022 Klaus Wenninger <kwenning@redhat.com> - 1.5.1-2
30bbda
- Be a bit more descriptive on issues opening watchdog-devices
30bbda
30bbda
  Resolves: rhbz#1841402
30bbda
d3a775
* Wed Dec 1 2021 Klaus Wenninger <kwenning@redhat.com> - 1.5.1-1
d3a775
- rebase to upstream v1.5.1
d3a775
d3a775
  Resolves: rhbz#2013256
d3a775
08d4e6
* Wed Aug 18 2021 Klaus Wenninger <kwenning@redhat.com> - 1.5.0-2
08d4e6
- reverted watchdog_timeout_default to 5s
08d4e6
  (slipped in via an unreleased change on 8.4.0 branch)
08d4e6
08d4e6
  Resolves: rhbz#1980797
08d4e6
08d4e6
* Mon Jul 19 2021 Klaus Wenninger <kwenning@redhat.com> - 1.5.0-1
08d4e6
- rebase to upstream v1.5.0
08d4e6
- sync with c9s & fedora
08d4e6
08d4e6
  Resolves: rhbz#1980797
08d4e6
08d4e6
* Mon Feb 1 2021 Klaus Wenninger <kwenning@redhat.com> - 1.4.2-3
08d4e6
- change the default for SBD_WATCHDOG_TIMEOUT to 10s
08d4e6
  s390(x) stays at 15s as before
08d4e6
08d4e6
  Resolves: rhbz#1922143
08d4e6
cfb415
* Thu Jan 28 2021 Klaus Wenninger <kwenning@redhat.com> - 1.4.2-2
cfb415
- update SBD_SYNC_RESOURCE_STARTUP description for
cfb415
  configurable default
cfb415
cfb415
  Resolves: rhbz#1915874
cfb415
cfb415
* Thu Dec 3 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.2-1
cfb415
- rebase to upstream v1.4.2
cfb415
- make sbd default to do pacemakerd-api handshake
cfb415
- conflict with pacemaker-libs < 2.0.5-4 to assure pacemaker
cfb415
  is defaulting to pacemakerd-api handshake
cfb415
cfb415
  Resolves: rhbz#1903730
cfb415
  Resolves: rhbz#1873135
cfb415
bf8527
* Thu Jul 30 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-7
bf8527
- conflict with pacemaker-libs < 2.0.4-5 instead of requiring
bf8527
  a minimum pacemaker version
bf8527
bf8527
  Resolves: rhbz#1861713
bf8527
bf8527
* Mon Jul 27 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-6
bf8527
- match qdevice-sync_timeout against wd-timeout
bf8527
- sync startup/shutdown via pacemakerd-api
bf8527
bf8527
  Resolves: rhbz#1703128
bf8527
  Resolves: rhbz#1743726
bf8527
bf8527
* Wed Jun 24 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-5
bf8527
- rebuild against pacemaker having new no_quorum_demote
bf8527
bf8527
  Resolves: rhbz#1850078
bf8527
bf8527
* Wed Jun 24 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-4
bf8527
- handle new no_quorum_demote in pacemaker
bf8527
bf8527
  Resolves: rhbz#1850078
bf8527
f975ad
* Mon Feb 17 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-3
f975ad
- append the man-page by a section auto-generated from
f975ad
  sbd.sysconfig
f975ad
f975ad
  Resolves: rhbz#1803826
f975ad
f975ad
* Wed Nov 20 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-2
f975ad
- silence coverity regarding inconsistent parameter passing
f975ad
- adapt fence-agents-dependency from upstream to distribution
f975ad
f975ad
  Resolves: rhbz#1769305
f975ad
f975ad
* Tue Nov 19 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-1
f975ad
- rebase to upstream v1.4.0
f975ad
f975ad
  Resolves: rhbz#1769305
f975ad
  Resolves: rhbz#1768906
f975ad
29e83d
* Fri Aug 16 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-15
29e83d
- check for shutdown attribute on every cib-diff
646f31
29e83d
  Resolves: rhbz#1718296
646f31
29e83d
* Wed Jun 12 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-10
29e83d
- added missing patches to git
646f31
29e83d
  Resolves: rhbz#1702727
29e83d
  Resolves: rhbz#1718296
646f31
29e83d
* Tue Jun 11 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-9
646f31
- assume graceful pacemaker exit if leftovers are unmanaged
29e83d
- query corosync liveness via votequorum-api
29e83d
29e83d
  Resolves: rhbz#1702727
29e83d
  Resolves: rhbz#1718296
29e83d
29e83d
* Mon Jun 3 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-8
29e83d
- check for rt-budget > 0 and move to root-slice otherwise
29e83d
29e83d
  Resolves: rhbz#1713021
646f31
29e83d
* Wed Apr 10 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-7
29e83d
- add some minor fixes from upstream found by coverity
29e83d
29e83d
  Resolves: rhbz#1698056
29e83d
29e83d
* Wed Apr 10 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-6
29e83d
- add decision-context to gating.yaml
29e83d
29e83d
  Resolves: rhbz#1682137
29e83d
29e83d
* Mon Jan 14 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-5
29e83d
- rebase to upstream v1.4.0
29e83d
- finalize cmap connection if disconnected from cluster
29e83d
- make handling of cib-connection loss more robust
29e83d
- add ci test files
29e83d
- use generic term cluster-services in doc
29e83d
- stress in doc that on-disk metadata watchdog-timeout
29e83d
  takes precedence
29e83d
- fail earlier on invalid servants to make gcc 9 happy
29e83d
29e83d
  Resolves: rhbz#1698056
29e83d
  Resolves: rhbz#1682137
Pablo Greco bf5149
6f8c14
* Mon Dec 17 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-18
6f8c14
- make timeout-action executed by sbd configurable
6f8c14
6f8c14
  Resolves: rhbz#1660147
6f8c14
6f8c14
* Mon Dec 3 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-17
6f8c14
- use pacemaker's new pe api with constructors/destructors
6f8c14
6f8c14
  Resolves: rhbz#1650663
6f8c14
6f8c14
* Wed Sep 19 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-16
6f8c14
- avoid statting potential symlink-targets in /dev
6f8c14
6f8c14
  Resolves: rhbz#1629020
6f8c14
6f8c14
* Wed Sep 19 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-15
6f8c14
- rebuild against new versions of libqb (1.0.3-7.el8),
6f8c14
  corosync (2.99.3-4.el8) and pacemaker (2.0.0-9.el8)
6f8c14
6f8c14
  Related: rhbz#1615945
6f8c14
6f8c14
* Fri Sep 14 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-14
6f8c14
- skip symlinks pointing to dev-nodes outside of /dev
6f8c14
6f8c14
  Resolves: rhbz#1629020
6f8c14
6f8c14
* Wed Sep 5 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-13
6f8c14
- Require systemd-package during build to have the macros
6f8c14
6f8c14
  Resolves: rhbz#1625553
6f8c14
6f8c14
* Mon Jul 30 2018 Florian Weimer <fweimer@redhat.com> - 1.3.1-12
6f8c14
- Rebuild with fixed binutils
6f8c14
6f8c14
* Tue Jul 3 2018 <kwenning@redhat.com> - 1.3.1-11
6f8c14
- replaced tarball by version downloaded from github
6f8c14
6f8c14
* Mon Jul 2 2018 <kwenning@redhat.com> - 1.3.1-10
6f8c14
- removed unneeded python build-dependency
6f8c14
- updated legacy corosync-devel to corosynclib-devel
6f8c14
6f8c14
  Resolves: rhbz#1595856
6f8c14
6f8c14
* Fri May 4 2018 <kwenning@redhat.com> - 1.3.1-9
6f8c14
- use cib-api directly as get_cib_copy gone with
6f8c14
  pacemaker 2.0.0
6f8c14
- add sys/sysmacros.h to build with glibc-2.25
6f8c14
- enlarge string buffer to satisfy newer gcc
6f8c14
- no corosync 1 support with pacemaker 2.0.0
6f8c14
- set default to LOG_NOTICE + overhaul levels
6f8c14
- refactor proc-parsing
6f8c14
- adaptions for daemon-names changed with
6f8c14
  pacemaker 2.0.0 rc3
6f8c14
- added .do-not-sync-with-fedora
6f8c14
  Resolves: rhbz#1571797
6f8c14
6f8c14
* Mon Apr 16 2018 <kwenning@redhat.com> - 1.3.1-8
6f8c14
- Added aarch64 target
6f8c14
6f8c14
  Resolves: rhbz#1568029
6f8c14
6f8c14
* Mon Jan 15 2018 <kwenning@redhat.com> - 1.3.1-7
6f8c14
- reenable sbd on upgrade so that additional
6f8c14
  links to make pacemaker properly depend on
6f8c14
  sbd are created
6f8c14
6f8c14
  Resolves: rhbz#1525981
6f8c14
6f8c14
* Wed Jan 10 2018 <kwenning@redhat.com> - 1.3.1-5
6f8c14
- add man sections for query- & test-watchdog
6f8c14
6f8c14
  Resolves: rhbz#1462002
6f8c14
6f8c14
* Wed Dec 20 2017 <kwenning@redhat.com> - 1.3.1-3
6f8c14
- mention timeout caveat with SBD_DELAY_START
6f8c14
  in configuration template
6f8c14
- make systemd wait for sbd-start to finish
6f8c14
  before starting pacemaker or dlm
6f8c14
6f8c14
  Resolves: rhbz#1525981
6f8c14
6f8c14
* Fri Nov 3 2017 <kwenning@redhat.com> - 1.3.1-2
6f8c14
- rebase to upstream v1.3.1
6f8c14
6f8c14
  Resolves: rhbz#1499864
6f8c14
            rhbz#1468580
6f8c14
            rhbz#1462002
6f8c14
6f8c14
* Wed Jun 7 2017 <kwenning@redhat.com> - 1.3.0-3
6f8c14
- prevent creation of duplicate servants
6f8c14
- check 2Node flag in corosync to support
6f8c14
  2-node-clusters with shared disk fencing
6f8c14
- move disk-triggered reboot/off/crashdump
6f8c14
  to inquisitor to have sysrq observed by watchdog
6f8c14
6f8c14
  Resolves: rhbz#1413951
6f8c14
6f8c14
* Sun Mar 26 2017 <kwenning@redhat.com> - 1.3.0-1
6f8c14
- rebase to upstream v1.3.0
6f8c14
- remove watchdog-limitation from description
6f8c14
  Resolves: rhbz#1413951
6f8c14
6f8c14
* Mon Feb 27 2017 <kwenning@redhat.com> - 1.2.1-23
6f8c14
- if shared-storage enabled check for node-name <= 63 chars
6f8c14
  Resolves: rhbz#1413951
6f8c14
6f8c14
* Tue Jan 31 2017 <kwenning@redhat.com> - 1.2.1-22
6f8c14
- Rebuild with shared-storage enabled
6f8c14
- Package original manpage
6f8c14
- Added ppc64le target
6f8c14
  Resolves: rhbz#1413951
6f8c14
6f8c14
* Fri Apr 15 2016 <kwenning@redhat.com> - 1.2.1-21
6f8c14
- Rebuild for new pacemaker
6f8c14
  Resolves: rhbz#1320400
6f8c14
6f8c14
* Fri Apr 15 2016 <kwenning@redhat.com> - 1.2.1-20
6f8c14
- tarball updated to c511b0692784a7085df4b1ae35748fb318fa79ee
6f8c14
  from https://github.com/Clusterlabs/sbd
6f8c14
  Resolves: rhbz#1324240
6f8c14
6f8c14
* Thu Jul 23 2015 <abeekhof@redhat.com> - 1.2.1-5
6f8c14
- Rebuild for pacemaker
6f8c14
6f8c14
* Tue Jun 02 2015 <abeekhof@redhat.com> - 1.2.1-4
6f8c14
- Include the dist tag in the release string
6f8c14
- Rebuild for new pacemaker
6f8c14
6f8c14
* Mon Jan 12 2015 <abeekhof@redhat.com> - 1.2.1-3
6f8c14
- Correctly parse SBD_WATCHDOG_TIMEOUT into seconds (not milliseconds)
6f8c14
6f8c14
* Mon Oct 27 2014 <abeekhof@redhat.com> - 1.2.1-2
6f8c14
- Correctly enable /proc/pid validation for sbd_lock_running()
6f8c14
6f8c14
* Fri Oct 24 2014 <abeekhof@redhat.com> - 1.2.1-1
6f8c14
- Further improve integration with the el7 environment
6f8c14
6f8c14
* Thu Oct 16 2014 <abeekhof@redhat.com> - 1.2.1-0.5.872e82f3.git
6f8c14
- Disable unsupported functionality (for now)
6f8c14
6f8c14
* Wed Oct 15 2014 <abeekhof@redhat.com> - 1.2.1-0.4.872e82f3.git
6f8c14
- Improved integration with the el7 environment
6f8c14
6f8c14
* Tue Sep 30 2014 <abeekhof@redhat.com> - 1.2.1-0.3.8f912945.git
6f8c14
- Only build on archs supported by the HA Add-on
6f8c14
6f8c14
* Fri Aug 29 2014 <abeekhof@redhat.com> - 1.2.1-0.2.8f912945.git
6f8c14
- Remove some additional SUSE-isms
6f8c14
6f8c14
* Fri Aug 29 2014 <abeekhof@redhat.com> - 1.2.1-0.1.8f912945.git
6f8c14
- Prepare for package review