1 Summary: heartbeat - heartbeat subsystem for High-Availability Linux
2 Summary(pl): podsystem heartbeat dla systemów o podwy¿szonej niezawodno¶ci
7 URL: http://linux-ha.org/
9 Source0: http://linux-ha.org/download/%{name}-%{version}.tar.gz
10 Patch0: %{name}.dirty.time.h.patch
11 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
14 Prereq: /sbin/chkconfig
17 #Summary: Provides an interface to Shoot The Other Node In The Head
21 heartbeat is a basic heartbeat subsystem for Linux-HA. It will run
22 scripts at initialization, and when machines go up or down. This
23 version will also perform IP address takeover using gratuitous ARPs.
24 It works correctly for a 2-node configuration, and is extensible to
25 larger configurations.
27 It implements the following kinds of heartbeats:
28 - Bidirectional Serial Rings ("raw" serial ports)
31 heartbeat jest podstawowym podsystemem dla systemów o podwy¿szonej
32 dostêpno¶ci budowanych w oparciu o Linuxa. Zajmuje siê uruchamianiem
33 skryptów podczas startu i zamykania systemu. Ta wersja pakietu pozwala
34 na przejmowanie adresów IP. Oprogramowanie dzia³a poprawnie dla
35 konfiguracji sk³adaj±cej siê z 2 hostów, mo¿na je równie¿ stosowaæ do
36 bardziej skomplikowanych konfiguracji.
45 sed -e 's/MAKE=gmake/MAKE=make/g' < Makefile > aqq
48 sed -e 's/lynx/links/' > aqq < Makefile
52 ###########################################################
54 ###########################################################
55 rm -rf $RPM_BUILD_ROOT
57 [ -z "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]
59 rm -rf $RPM_BUILD_ROOT
61 RPM_BUILD=yes BUILD_ROOT=$RPM_BUILD_ROOT make install
63 cd $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
65 ln -sf %{_sbindir}/ldirectord ldirectord
68 TEMPL=$RPM_BUILD_ROOT/var/adm/fillup-templates
74 install rc.config.heartbeat $TEMPL
76 ###########################################################
78 %defattr(644,root,root,755)
79 ###########################################################
81 %dir %{_sysconfdir}/ha.d
82 %{_sysconfdir}/ha.d/harc
83 %{_sysconfdir}/ha.d/shellfuncs
84 %{_sysconfdir}/ha.d/rc.d
85 %{_sysconfdir}/ha.d/README.config
86 %{_sysconfdir}/ha.d/conf
88 %{_libdir}/libhbclient.so
89 %{_libdir}/libhbclient.a
90 %{_sysconfdir}/ha.d/resource.d/
91 %{_sysconfdir}/init.d/heartbeat
92 /etc/logrotate.d/heartbeat
93 /var/adm/fillup-templates/rc.config.heartbeat
94 %dir /var/lib/heartbeat
95 %attr (600, root, root) /var/lib/heartbeat/fifo
96 %attr (750, root, haclient) /var/lib/heartbeat/api
97 %attr (620, root, haclient) /var/lib/heartbeat/register
98 %attr (1770, root, haclient) /var/lib/heartbeat/casual
99 %{_mandir}/man8/heartbeat.8*
103 ###########################################################
105 ###########################################################
106 rm -rf $RPM_BUILD_ROOT
107 rm -rf $RPM_BUILD_DIR/heartbeat-0.4.9
109 ###########################################################
111 ###########################################################
113 # This isn't perfect. But getting every distribution
114 # to agree on group id's seems hard to me :-(
117 grep '^haclient:' etc/group >/dev/null
119 : OK group haclient already present
123 usr/sbin/groupadd $GROUPOPT haclient 2>/dev/null
125 : OK we were able to add group haclient
127 usr/sbin/groupadd haclient
131 # Multi-distribution kludge for init scripts...
137 [ -d sbin/init.d -a ! -L sbin/init.d ]
139 ln -s ../sbin/init.d etc/init.d
141 [ -d etc/rc.d/init.d ]
143 ln -s rc.d/init.d etc/init.d
146 echo "Warning: making directory /etc/init.d"
150 ###########################################################
152 # Multi-distribution kludge for init scripts...
158 [ -d sbin/init.d -a ! -L sbin/init.d ]
160 ln -s ../sbin/init.d etc/init.d
162 [ -d etc/rc.d/init.d ]
164 ln -s rc.d/init.d etc/init.d
167 echo "Warning: making directory /etc/init.d"
171 ###########################################################
173 ###########################################################
175 # Run heartbeat on startup
177 [ -f etc/SuSE-release ]
179 for d in etc/rc.d/init.d/rc[23].d
181 rm -f $d/S10heartbeat
182 rm -f $d/S99heartbeat; ln -s ../heartbeat $d/S99heartbeat
183 rm -f $d/K35heartbeat; ln -s ../heartbeat $d/K35heartbeat
187 $FILLUP -q -d = etc/rc.config var/adm/fillup-templates/rc.config.heartbeat
191 echo "ERROR: $FILLUP failed. This should not happen. Please compare"
192 echo "/etc/rc.config and /var/adm/fillup-templates/rc.config.heartbeat"
193 echo "and update by hand."
196 [ -x sbin/chkconfig ]
198 sbin/chkconfig --add heartbeat
202 ###########################################################
204 ###########################################################
206 Uninstall_PPP_hack() {
207 file2hack=etc/ppp/ip-up.local
208 echo "NOTE: Restoring /$file2hack"
210 ed -s $file2hack <<-!EOF 2>/dev/null
220 [ -x sbin/chkconfig ] && sbin/chkconfig --del heartbeat
222 [ ! -x etc/ppp/ip-up.heart ]
228 [ -r etc/SuSE-release ]
230 rm -f sbin/init.d/rc[23]/*heartbeat