Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > main-src > by-pkgid > d3346148ea75932c2f8d5c33e25591ff > files > 7

heartbeat-0.4.9-1mdk.src.rpm

%define version	0.4.9
%define release	1mdk
%define name 	heartbeat
%define realname	heartbeat
%define prefix  /usr

Summary:        Heartbeat - heartbeat subsystem for High-Availability Linux
Name:	        %{name}
Version:	%{version}
Release:	%{release}
License:      GPL
URL:            http://linux-ha.org/
Group:          System/Servers
Source0:        http://linux-ha.org/download/%{realname}-%{version}.tar.bz2
Source1:		haresources
Source2:		ha.cf
Source3:		authkeys
Source4:		www.cf
Patch0:			ldirectord-init.patch
Patch1:			heartbeat-time.patch
Patch2:			heartbeat-init.patch
Requires: sysklogd
BuildRequires:	db3-devel lynx
Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root/

%package ldirectord
Summary: Monitor daemon for maintaining high availability resources
Group: System/Servers
Requires: perl, perl-libwww-perl perl-Net_SSLeay, ipvsadm

%package stonith
Summary: Provides an interface to Shoot The Other Node In The Head
Group: System/Servers

%description ldirectord
ldirectord is a stand-alone daemon to monitor services of real
for virtual services provided by The Linux Virtual Server
(http://www.linuxvirtualserver.org/). It is simple to install
and works with the heartbeat code (http://www.linux-ha.org/).

%description stonith
The STONITH module (a.k.a. STOMITH) provides an extensible interface
for remotely powering down a node in the cluster.  The idea is quite simple:
When the software running on one machine wants to make sure another
machine in the cluster is not using a resource, pull the plug on the other
machine. It's simple and reliable, albeit admittedly brutal.

%description
heartbeat is a basic heartbeat subsystem for Linux-HA.
It will run scripts at initialization, and when machines go up or down.
This version will also perform IP address takeover using gratuitious ARPs.
It works correctly for a 2-node configuration, and is extensible to larger
configurations.

It implements the following kinds of heartbeats:
	- Bidirectional Serial Rings ("raw" serial ports)
	- UDP/IP braodcast (ethernet, etc)
	- Bidirectional Serial PPP/UDP Rings (using PPP)

%prep
%setup -q
%patch0 -p0 -b .orig
%patch1 -p1 -b .orig
%patch2 -p0 -b .orig

%build
%serverbuild
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -DUSE_VENDOR_CF_PATH=1"
%make 

%install
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/ppp.d

%makeinstall BUILD_ROOT=$RPM_BUILD_ROOT \
			 INITSCRIPT=$RPM_BUILD_ROOT%{_initrddir} \
			LOGROTATEDIR=$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d \
			MANDIR=$RPM_BUILD_ROOT/%{_mandir}
			DOCDIR=$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} \
			INITD=$RPM_BUILD_ROOT%{_initrddir} \

mv $RPM_BUILD_ROOT%{_initrddir}/heartbeat.sh $RPM_BUILD_ROOT%{_initrddir}/heartbeat
mv $RPM_BUILD_ROOT/etc/init.d/ldirectord $RPM_BUILD_ROOT%{_initrddir}/ldirectord

install -m644 %{SOURCE1}  $RPM_BUILD_ROOT%{_sysconfdir}/ha.d
install -m644 %{SOURCE2}  $RPM_BUILD_ROOT%{_sysconfdir}/ha.d
install -m600 %{SOURCE3}  $RPM_BUILD_ROOT%{_sysconfdir}/ha.d
install -m644 %{SOURCE4}  $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/conf
# TEMPL=$RPM_BUILD_ROOT/var/lib/heartbeat/fillup-templates
# mkdir -p $TEMPL
# install -m 644 rc.config.heartbeat $TEMPL
# 

install -m644 ldirectord/ldirectord.cf  $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/conf

%clean
rm -rf $RPM_BUILD_ROOT

%pre
if grep -q '^haclient:' etc/group >/dev/null ; then
: 
else
	GROUPOPT="-g 60"
	if
			usr/sbin/groupadd $GROUPOPT haclient 2>/dev/null
		then
		:
		else
			usr/sbin/groupadd haclient
		fi
fi

%post
#
#	Hack to allow ppp-udp to be notified about PPP processes starting
#
Install_PPP_hack() {
  file2hack=/etc/ppp/ip-up.local
  echo "NOTE: Modifying $file2hack"
  if
    [ ! -f $file2hack ]
  then
    echo '#!/bin/bash' > $file2hack
    chmod 755 $file2hack
  fi
  MARKER="Heartbeat"
  ed -s $file2hack <<-!EOF  2>/dev/null
H
g/ $MARKER\$/d
\$a
#	The following lines added for Linux-HA support		# $MARKER
DEVFILE=\`echo \$DEVICE | sed -e 's!^/dev/!!' -e 's!/!.!g'\`	# $MARKER
OUTFILE=/etc/ha.d/ppp.d/\$DEVFILE				# $MARKER
(			# $MARKER
echo "\$IPREMOTE"	# $MARKER
echo "\$IFNAME"		# $MARKER
echo "\$PPPD_PID"	# $MARKER
echo "\$IPLOCAL"		# $MARKER
) > \$OUTFILE		# $MARKER
.
w
!EOF
}

if
  [ ! -x /etc/ppp/ip-up.heart ]
then
  Install_PPP_hack
fi

# Run heartbeat on startup
%_post_service heartbeat

%preun

Uninstall_PPP_hack() {
  file2hack=/etc/ppp/ip-up.local
  echo "NOTE: Restoring $file2hack"
  MARKER="Heartbeat"
  ed -s $file2hack <<-!EOF  2>/dev/null
H
g/ $MARKER\$/d
w
!EOF
}

if [ $1 = 0 ]; then
%_preun_service heartbeat
  if [ ! -x /etc/ppp/ip-up.heart ]; then
    Uninstall_PPP_hack
  fi
fi

%files
%defattr(-,root,root)
%doc doc heartbeat/misc heartbeat/README.config heartbeat/TestCluster proc-ha 
%doc cts Specfile
%dir %{_var}/lib/heartbeat
%attr (600, root, root)       %{_var}/lib/heartbeat/fifo
%attr (750, root, haclient) %{_var}/lib/heartbeat/api
%attr (620, root, haclient) %{_var}/lib/heartbeat/register
%attr (1770, root, haclient) %{_var}/lib/heartbeat/casual

%dir /usr/lib/heartbeat/

%{_mandir}/man8/heartbeat*
%config(noreplace)  %{_sysconfdir}/logrotate.d/heartbeat
/usr/lib/heartbeat/*

/usr/lib/libhbclient.a
/usr/lib/libhbclient.so

%dir %{_sysconfdir}/ha.d
%config(noreplace) %{_sysconfdir}/ha.d/ppp.d/
%config(noreplace) %{_sysconfdir}/ha.d/rc.d/
%config(noreplace) %{_sysconfdir}/ha.d/resource.d/
%config(noreplace) %{_sysconfdir}/ha.d/conf/
%attr(0644,root,root) %config(noreplace)  %{_sysconfdir}/ha.d/shellfuncs
%attr(0756,root,root) %config(noreplace)  %{_sysconfdir}/ha.d/harc
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ha.d/authkeys
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ha.d/ha.cf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ha.d/haresources
%attr(0755,root,root) %config(noreplace) %{_initrddir}/heartbeat
%dir %{_var}/run/ppp.d


%files ldirectord
%defattr(-,root,root)
%doc ldirectord/ldirectord.cf ldirectord/README
%config(noreplace) %{_sysconfdir}/ha.d/conf/ldirectord.cf
%config(noreplace)  %{_sysconfdir}/logrotate.d/ldirectord
%attr(0755,root,root) %config(noreplace) %{_initrddir}/ldirectord
/usr/sbin/ldirectord
%{_mandir}/man8/ldirectord*

%files stonith
%defattr(-,root,root)
/usr/lib/libstonith.a
/usr/lib/libstonith.so
%dir /usr/lib/stonith/*.so
/usr/sbin/stonith
/usr/sbin/meatclient
/usr/include/stonith.h

%changelog
* Tue Oct 09 2001 Philippe Libat <philippe@mandrakesoft.com> 0.4.9-1mdk
- new version 0.4.9
- split package

* Mon Oct 08 2001 Stefan van der Eijk <stefan@eijk.nu> 0.4.8-5mdk
- BuildRequires: db3-devel
- Copyright --> License

* Fri Mar 30 2001 Philippe Libat <philippe@mandrakesoft.com>  0.4.8-4mdk
- use post_service and preun_service macros
- use serverbuild macro

* Tue Sep 12 2000 Philippe Libat <philippe@mandrakesoft.com>  0.4.8-3mdk
- patch ldirectord init script

* Thu Aug 31 2000 Philippe Libat <philippe@mandrakesoft.com>  0.4.8-2mdk
- add www.cf config
- add %{_sysconfdir} %{_var}

* Wed Aug 30 2000 Philippe Libat <philippe@mandrakesoft.com>  0.4.8-1mdk
- update version 0.4.8
- replace %_mandir %{_docdir} %_initrddir

* Tue Jul 4 2000 Nicolas Planel <nicolas@mandrakesoft.com> 
- Spec file was generated for Linux-Mandrake distribution.
 
* Sat Dec 25 1999  Alan Robertson <alanr@henge.com>,
     Volker Wiegand <wiegand@suse.de>, Rudy Pawul <rpawul@iso-ne.com>,
     Mitja Sarp <mitja@lysator.liu.se>, Jacob Rief <jacob.rief@tis.at>
     and Guenther Thomsen <thomsen@cs.tu-berlin.de>

+ Version 0.4.7
  + Put in lots of code to make lost packet retransmission happen
  + Stopped trying to use the /proc/ha interface
  + Finished the error recovery in the heartbeat protocol (and got it to work)
  + Added test code for the heartbeat protocol
  + Raised the maximum length of a node name
  + Added Jacob Rief's ldirectord resource type
  + Added Stefan Salzer's <salt@cin.de> fix for a 'grep' in IPaddr which
	wasn't specific enough and would sometimes get IPaddr confused on
	IP addresses that prefix-matched.
  + Added Lars Marowsky-Bree's suggestion to make the code almost completely
	robust with respect to jumping the clock backwards and forwards
  + Added code from Michael Moerz <mike@cubit.at> to keep findif from
	core dumping if /proc/route can't be read.

* Mon Nov 22 1999  Alan Robertson <alanr@henge.com>,
     Volker Wiegand <wiegand@suse.de>, Rudy Pawul <rpawul@iso-ne.com>,
     Mitja Sarp <mitja@lysator.liu.se>,
     and Guenther Thomsen <thomsen@cs.tu-berlin.de>

* Tue Nov 22 1999  Alan Robertson <alanr@henge.com>,
     Volker Wiegand <wiegand@suse.de>, Rudy Pawul <rpawul@iso-ne.com>,
     Mitja Sarp <mitja@lysator.liu.se>,
     and Guenther Thomsen <thomsen@cs.tu-berlin.de>,

+ Version 0.4.6
  + Fixed timing problem in "heartbeat restart" so it's reliable now
  + Made start/stop status compatible with SuSE expectations
  + Made resource status detection compatible with SuSE start/stop expectations
  + Fixed a bug relating to serial and ppp-udp authentication (it never worked)
  + added a little more substance to the error recovery for the HB protocol.
  + Fixed a bug for logging from shell scripts
  + Added a little logging for initial resource acquisition
  + Added #!/bin/sh to the front of shell scripts
  + Fixed Makefile, so that the build root wasn't compiled into pathnames
  + Turned on CTSRTS, enabling for flow control for serial ports.
  + Fixed a bug which kept it from working in non-English environments

* Wed Oct 13 1999  Alan Robertson <alanr@henge.com>,
     Volker Wiegand <wiegand@suse.de>, Rudy Pawul <rpawul@iso-ne.com>,
     Mitja Sarp <mitja@lysator.liu.se>,
     and Guenther Thomsen <thomsen@cs.tu-berlin.de>

+ Version 0.4.5
  + Mijta Sarp added a new feature to authenticate heartbeat packets
	using a variety of strong authentication techniques
  + Changed resource acquisition and relinquishment to occur in heartbeat,
       instead of in the start/stop script.  This means you don't *really*
       have to use the start/stop script if you don't want to.
  + Added -k option to gracefully shut down current heartbeat instance
  + Added -r option to cause currently running heartbeat to reread config files
  + Added -s option to report on operational status of "heartbeat"
  + Sped up resource acquisition on master restart.
  + Added validation of ipresources file at startup time.
  + Added code to allow the IPaddr takeover script to be given the
        interface to take over, instead of inferring it.  This was requested
        by Lars Marowsky-Bree
  + Incorporated patch from Guenther Thomsen to implement locking for
        serial ports used for heartbeats
  + Incorporated patch from Guenther Thomsen to clean up logging.
        (you can now use syslog and/or file logs)
  + Improved FreeBSD compatibility.
  + Fixed a bug where the FIFO doesn't get created correctly.
  + Fixed a couple of uninitialized variables in heartbeat and /proc/ha code
  + Fixed longstanding crash bug related to getting a SIGALRM while in malloc
	or free.
  + Implemented new memory management scheme, including memory stats

* Thu Sep 16 1999  Alan Robertson <alanr@henge.com>,
     Volker Wiegand <wiegand@suse.de>, and Rudy Pawul <rpawul@iso-ne.com>
+ Version 0.4.4
  + Fixed a stupid error in handling CIDR addresses in IPaddr.
  + Updated the documentation with the latest from Rudy.

* Wed Sep 15 1999  Alan Robertson <alanr@henge.com>,
     Volker Wiegand <wiegand@suse.de>, and Rudy Pawul <rpawul@iso-ne.com>
+ Version 0.4.3
  + Changed startup scripts to create /dev/watchdog if needed
  + Turned off loading of /proc/ha module by default.
  + Incorporated bug fix from Thomas Hepper <th@ant.han.de> to IPaddr for
	PPP configurations
  + Put in a fix from Gregor Howey <ghowey@bremer-nachrichten.de>
	where Gregor found that I had stripped off the ::resourceid part
	of the string in ResourceManager resulting in some bad calls later on.
  +  Made it compliant with the FHS (filesystem hierarchy standard)
  +  Fixed IP address takeover so we can take over on non-eth0 interface
  +  Fixed IP takeover code so we can specify netmasks and broadcast addrs,
	or default them at the user's option.
  +  Added code to report on message buffer usage on SIGUSR[12]
  +  Made SIGUSR1 increment debug level, and SIGUSR2 decrement it.
  +  Incorporated Rudy's latest "Getting Started" document
  +  Made it largely Debian-compliant.  Thanks to Guenther Thomsen, Thomas
	Hepper, Iñaki Fernández Villanueva and others.
  +  Made changes to work better with Red Hat 6.1, and SMP code.
  +  Sometimes it seems that the Master Control Process dies :-(

* Sat Aug 14 1999  Alan Robertson <alanr@henge.com>,
     Volker Wiegand <wiegand@suse.de>, and Rudy Pawul <rpawul@iso-ne.com>
+ Version 0.4.2
  + Implemented simple resource groups
  + Implemented application notification for groups starting/stopping
  + Eliminated restriction on floating IPs only being associated with eth0
  + Added a uniform resource model, with IP resources being only one kind.
	(Thanks to Lars Marowsky-Bree for a good suggestion)
  + Largely rewrote the IP address takeover code, making it clearer, fit
	into the uniform resource model, and removing some restrictions.
  + Preliminary "Getting Started" document by Rudy Pawul
  + Improved the /proc/ha code
  + Fixed memory leak associated with serial ports, and problem with return
	of control to the "master" node.
	(Thanks to Holger Kiehl for reporting them, and testing fixes!)

* Tue Jul 6 1999  Alan Robertson <alanr@henge.com> and
     Volker Wiegand <Volker.Wiegand@SuSE.de>
+ Version 0.4.1
  + Fixed major memory leak in 0.4.0 (oops!)
  + Added code to eliminate duplicate packets and log lost ones
  + Tightened up PPP/UDP startup/shutdown code
  + Made PPP/UDP peacefully coexist with "normal" udp
  + Made logs more uniform and neater
  + Fixed several other minor bugs
  + Added very preliminary kernel code for monitoring and controlling
	heartbeat via /proc/ha.  Very cool, but not really done yet.

* Wed Jun 30 1999 Alan Robertson <alanr@henge.com>
+ Version 0.4.0
  + Changed packet format from single line positional parameter style
	to a collection of {name,value} pairs.  A vital change for the future.
  + Fixed some bugs with regard to forwarding data around rings
  + We now modify /etc/ppp/ip-up.local, so PPP-udp works out of the box
	(at least for Red Hat)
  + Includes the first version of Volker Wiegand's Hardware Installation Guide
	(it's pretty good for a first version!)

* Wed Jun 09 1999 Alan Robertson <alanr@henge.com>
+ Version 0.3.2
  + Added UDP/PPP bidirectional serial ring heartbeat
	(PPP ensures data integrity on the serial links)
  + fixed a stupid bug which caused shutdown to give unpredictable
	results
  + added timestamps to /var/log/ha-log messages
  + fixed a couple of other minor oversights.

* Sun May 10 1999 Alan Robertson <alanr@henge.com>
+ Version 0.3.1
  + Make ChangeLog file from RPM specfile
  + Made ipresources only install in the DOC directory as a sample

* Sun May 09 1999 Alan Robertson <alanr@henge.com>
+ Version 0.3.0
  + Added UDP broadcast heartbeat (courtesy of Tom Vogt)
  + Significantly restructured code making it easier to add heartbeat media
  + added new directives to config file:
    + udp interface-name
    + udpport port-number
    + baud    serial-baud-rate
  + made manual daemon shutdown easier (only need to kill one)
  + moved the sample ha.cf file to the Doc directory

* Sat Mar 27 1999 Alan Robertson <alanr@henge.com>
+ Version 0.2.0
  + Make an RPM out of it
  + Integrated IP address takeover gotten from Horms
  + Added support to tickle a watchdog timer whenever our heart beats
  + Integrated enough basic code to allow a 2-node demo to occur
  + Integrated patches from Andrew Hildebrand <andrew@pdi.com> to allow it
    to run under IRIX.
  - Known Bugs
    - Only supports 2-node clusters
    - Only supports a single IP interface per node in the cluster
    - Doesn't yet include Tom Vogt's ethernet heartbeat code
    - No documentation
    - Not very useful yet :-)