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