[heartbeat/el6] Patch to build with rhel cluster-glue, fix for paths.
Kevin Fenzi
kevin at fedoraproject.org
Mon Dec 2 16:21:27 UTC 2013
commit ed5b0755177383d1885db38ba94c9e3d85f87039
Author: Kevin Fenzi <kevin at scrye.com>
Date: Mon Dec 2 09:20:56 2013 -0700
Patch to build with rhel cluster-glue, fix for paths.
heartbeat-3.0.4-clusterglue-workaround.patch | 101 ++++++++++++++++++++++++++
heartbeat-3.0.4-duplicate-ucast.patch | 35 +++++++++
heartbeat.spec | 10 +++-
3 files changed, 145 insertions(+), 1 deletions(-)
---
diff --git a/heartbeat-3.0.4-clusterglue-workaround.patch b/heartbeat-3.0.4-clusterglue-workaround.patch
new file mode 100644
index 0000000..a95f41c
--- /dev/null
+++ b/heartbeat-3.0.4-clusterglue-workaround.patch
@@ -0,0 +1,101 @@
+diff -r fd1b907a0de6 configure.in
+--- a/configure.in Fri Apr 05 09:42:49 2013 +0200
++++ b/configure.in Sat Nov 30 10:45:24 2013 +0100
+@@ -137,10 +137,10 @@
+ printf "#include <stdio.h>\n" > ${Cfile}.c
+ printf "#include <%s>\n" $1 >> ${Cfile}.c
+ printf "int main(int argc, char **argv) { printf(\"%%s\", %s); return 0; }\n" $2 >> ${Cfile}.c
+- $CC $CFLAGS ${Cfile}.c -o ${Cfile}
+- value=`${Cfile}`
++ value=""
++ $CC $CFLAGS ${Cfile}.c -o ${Cfile} && value=`${Cfile}`
+ AC_MSG_RESULT($value)
+- printf $value
++ printf "%s" $value
+ rm -f ${Cfile}.c ${Cfile}
+ }
+
+@@ -417,8 +417,17 @@
+ AC_SUBST(HA_NOARCHDATAHBDIR)
+ AC_DEFINE_UNQUOTED(HA_NOARCHDATAHBDIR,"$HA_NOARCHDATAHBDIR", $HB_PKG noarch data directory)
+
++
+ HA_LIBHBDIR=`extract_header_define $GLUE_HEADER HA_LIBHBDIR`
+ AC_SUBST(HA_LIBHBDIR)
++if test x"$HA_LIBHBDIR" = x ; then
++# see rhbz#805147 and
++# https://github.com/davidvossel/pacemaker/commit/44e7ba80e2a259f3b407e2d35cf8353572c6d769
++ AC_MSG_NOTICE($GLUE_HEADER does not define HA_LIBHBDIR, using fallback)
++# FIXME we need to use libexec for daemons, lib is only for shared objects
++ HA_LIBHBDIR="$libdir/heartbeat"
++ AC_DEFINE_UNQUOTED(HA_LIBHBDIR,"$HA_LIBHBDIR", lib and daemon directory)
++fi
+
+ HA_VARRUNDIR=`extract_header_define $GLUE_HEADER HA_VARRUNDIR`
+ AC_SUBST(HA_VARRUNDIR)
+diff -r fd1b907a0de6 heartbeat/init.d/heartbeat.in
+--- a/heartbeat/init.d/heartbeat.in Fri Apr 05 09:42:49 2013 +0200
++++ b/heartbeat/init.d/heartbeat.in Sat Nov 30 10:45:24 2013 +0100
+@@ -44,6 +44,8 @@
+ # Default-Stop: 0 1 6
+ ### END INIT INFO
+
++HEARTBEAT=@HA_LIBHBDIR@/heartbeat
++
+ [ -r @INITDEFDIR@/heartbeat ] && . @INITDEFDIR@/heartbeat
+ [ -r @INITDEFDIR@/pacemaker ] && . @INITDEFDIR@/pacemaker
+ [ -r @INITDEFDIR@/sbd ] && . @INITDEFDIR@/sbd
+@@ -138,7 +140,7 @@
+ # Set this to a 1 if you want to automatically load kernel modules
+ USE_MODULES=@USE_MODULES@
+
+-[ -x $HA_BIN/heartbeat ] || exit 0
++[ -x $HEARTBEAT ] || exit 0
+
+ #
+ # Some environments like it if we use their functions...
+@@ -148,7 +150,7 @@
+ then
+ # Provide our own versions of these functions
+ status() {
+- $HA_BIN/heartbeat -s
++ $HEARTBEAT -s
+ }
+ echo_failure() {
+ echo " Heartbeat failure [rc=$1]. $rc_failed"
+@@ -293,7 +295,7 @@
+
+ start_heartbeat() {
+ if
+- ERROR=`$HA_BIN/heartbeat 2>&1`
++ ERROR=`$HEARTBEAT 2>&1`
+ then
+ : OK
+ else
+@@ -375,7 +377,7 @@
+ echo -n "Stopping High-Availability services: "
+
+ if
+- $HA_BIN/heartbeat -k >/dev/null 2>&1 # Kill it
++ $HEARTBEAT -k >/dev/null 2>&1 # Kill it
+ then
+ StopSBD
+ echo_success
+@@ -388,7 +390,7 @@
+ }
+
+ StatusHA() {
+- $HA_BIN/heartbeat -s
++ $HEARTBEAT -s
+ }
+
+ StandbyHA() {
+@@ -434,7 +436,7 @@
+ echo -n "Reloading High-Availability services: "
+
+ if
+- $HA_BIN/heartbeat -r # Restart, and keep your resources
++ $HEARTBEAT -r # Restart, and keep your resources
+ then
+ echo_success
+ return 0
diff --git a/heartbeat-3.0.4-duplicate-ucast.patch b/heartbeat-3.0.4-duplicate-ucast.patch
new file mode 100644
index 0000000..16ebfc9
--- /dev/null
+++ b/heartbeat-3.0.4-duplicate-ucast.patch
@@ -0,0 +1,35 @@
+diff -Nur Heartbeat-3-0-STABLE-3.0.4.orig/lib/plugins/HBcomm/ucast.c Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/ucast.c
+--- Heartbeat-3-0-STABLE-3.0.4.orig/lib/plugins/HBcomm/ucast.c 2010-12-09 13:09:47.000000000 -0700
++++ Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/ucast.c 2013-11-27 09:29:00.237836275 -0700
+@@ -462,7 +462,7 @@
+ struct ip_private *ei;
+ int tos;
+ #if defined(SO_BINDTODEVICE)
+- struct ifreq i;
++ struct ifreq ifc;
+ #endif
+ #if defined(SO_REUSEPORT)
+ int i = 1;
+@@ -499,18 +499,18 @@
+ *
+ * This is so we can have redundant NICs, and heartbeat on both
+ */
+- strcpy(i.ifr_name, ei->interface);
++ strcpy(ifc.ifr_name, ei->interface);
+
+ if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
+- &i, sizeof(i)) == -1) {
++ &ifc, sizeof(ifc)) == -1) {
+ PILCallLog(LOG, PIL_CRIT,
+ "ucast: error setting option SO_BINDTODEVICE(w) on %s: %s",
+- i.ifr_name, strerror(errno));
++ ifc.ifr_name, strerror(errno));
+ close(sockfd);
+ return -1;
+ }
+ PILCallLog(LOG, PIL_INFO, "ucast: bound send socket to device: %s",
+- i.ifr_name);
++ ifc.ifr_name);
+ }
+ #endif
+ #if defined(SO_REUSEPORT)
diff --git a/heartbeat.spec b/heartbeat.spec
index 6563d12..e9368e7 100644
--- a/heartbeat.spec
+++ b/heartbeat.spec
@@ -2,7 +2,7 @@
# When downloading directly from Mercurial, it will automatically add this prefix
# Invoking 'hg archive' wont but you can add one with:
# hg archive -t tgz -p "Linux-HA-Dev-" -r $upstreamversion $upstreamversion.tar.gz
-%global specversion 1
+%global specversion 2
#global upstreamprefix Linux-HA-Dev-
%global upstreamprefix Heartbeat-3-0-
%global upstreamversion STABLE-3.0.4
@@ -27,6 +27,8 @@ Group: System Environment/Daemons
Source0: http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/STABLE-3.0.4.tar.bz2
Patch1: heartbeat-3.0.4-disable-xinclude.patch
Patch2: heartbeat-3.0.0-haresources.patch
+Patch3: heartbeat-3.0.4-clusterglue-workaround.patch
+Patch4: heartbeat-3.0.4-duplicate-ucast.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: glib2-devel
BuildRequires: iputils
@@ -99,6 +101,8 @@ Headers and shared libraries for writing programs for Heartbeat
%prep
%setup -q -n %{upstreamprefix}%{upstreamversion}
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
./bootstrap
@@ -188,6 +192,10 @@ fi
%{_libdir}/*.so
%changelog
+* Sat Nov 30 2013 Kevin Fenzi <kevin at scrye.com> 3.0.4-2
+- Apply patch to work around cluster-glue changes in rhel.
+- fixes 1028127 and 869826
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.4-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
More information about the scm-commits
mailing list