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/
10 #Packager: Alan Robertson <alanr@henge.com>
11 Source: http://linux-ha.org/download/heartbeat-0.4.9.tar.gz
12 Patch0: heartbeat.brzydki.patch
13 #Buildroot: /var/tmp/heartbeat-root
14 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19 #Summary: Provides an interface to Shoot The Other Node In The Head
23 heartbeat is a basic heartbeat subsystem for Linux-HA.
24 It will run scripts at initialization, and when machines go up or down.
25 This version will also perform IP address takeover using gratuitous ARPs.
26 It works correctly for a 2-node configuration, and is extensible to larger
30 It implements the following kinds of heartbeats:
31 - Bidirectional Serial Rings ("raw" serial ports)
32 - UDP/IP broadcast (ethernet, etc)
33 - Bidirectional Serial PPP/UDP Rings (using PPP)
34 - "ping" heartbeats (for routers, switches, etc.)
35 (to be used for breaking ties in 2-node systems)
37 heartbeat jest podstawowym podsystemem dla systemów o podwy¿szonej dostêpno¶ci budowanych w oparciu o Linuxa. Zajmuje siê uruchamianiem skryptów podczas startu i zamykania systemu. Ta wersja pakietu pozwala na przejmowanie adresów IP. Oprogramowanie dzia³a poprawnie dla konfiguracji sk³adaj±cej siê z 2 hostów, mo¿na je równie¿ stosowaæ do bardziej skomplikowanych konfiguracji.
44 #patch -p0 < %{PATCH0}
48 sed -e 's/MAKE=gmake/MAKE=make/g' < Makefile > aqq
51 sed -e 's/lynx/links/' > aqq < Makefile
55 ###########################################################
57 ###########################################################
59 [ -z "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]
61 rm -rf $RPM_BUILD_ROOT
63 RPM_BUILD=yes BUILD_ROOT=$RPM_BUILD_ROOT make install
65 cd $RPM_BUILD_ROOT/etc/ha.d/resource.d
67 ln -s /usr/sbin/ldirectord ldirectord
70 TEMPL=$RPM_BUILD_ROOT/var/adm/fillup-templates
76 install -m 644 rc.config.heartbeat $TEMPL
78 ###########################################################
80 ###########################################################
86 /etc/ha.d/README.config
89 /usr/lib/libhbclient.so
90 /usr/lib/libhbclient.a
93 /etc/logrotate.d/heartbeat
94 /var/adm/fillup-templates/rc.config.heartbeat
95 %dir /var/lib/heartbeat
96 %attr (600, root, root) /var/lib/heartbeat/fifo
97 %attr (750, root, haclient) /var/lib/heartbeat/api
98 %attr (620, root, haclient) /var/lib/heartbeat/register
99 %attr (1770, root, haclient) /var/lib/heartbeat/casual
100 /usr/man/man8/heartbeat.8*
104 ###########################################################
106 ###########################################################
107 rm -rf $RPM_BUILD_ROOT
108 rm -rf $RPM_BUILD_DIR/heartbeat-0.4.9
110 ###########################################################
112 ###########################################################
114 # This isn't perfect. But getting every distribution
115 # to agree on group id's seems hard to me :-(
118 grep '^haclient:' etc/group >/dev/null
120 : OK group haclient already present
124 usr/sbin/groupadd $GROUPOPT haclient 2>/dev/null
126 : OK we were able to add group haclient
128 usr/sbin/groupadd haclient
132 # Multi-distribution kludge for init scripts...
138 [ -d sbin/init.d -a ! -L sbin/init.d ]
140 ln -s ../sbin/init.d etc/init.d
142 [ -d etc/rc.d/init.d ]
144 ln -s rc.d/init.d etc/init.d
147 echo "Warning: making directory /etc/init.d"
151 ###########################################################
153 # Multi-distribution kludge for init scripts...
159 [ -d sbin/init.d -a ! -L sbin/init.d ]
161 ln -s ../sbin/init.d etc/init.d
163 [ -d etc/rc.d/init.d ]
165 ln -s rc.d/init.d etc/init.d
168 echo "Warning: making directory /etc/init.d"
172 ###########################################################
174 ###########################################################
176 # Run heartbeat on startup
178 [ -f etc/SuSE-release ]
180 for d in etc/rc.d/init.d/rc[23].d
182 rm -f $d/S10heartbeat
183 rm -f $d/S99heartbeat; ln -s ../heartbeat $d/S99heartbeat
184 rm -f $d/K35heartbeat; ln -s ../heartbeat $d/K35heartbeat
188 $FILLUP -q -d = etc/rc.config var/adm/fillup-templates/rc.config.heartbeat
192 echo "ERROR: $FILLUP failed. This should not happen. Please compare"
193 echo "/etc/rc.config and /var/adm/fillup-templates/rc.config.heartbeat"
194 echo "and update by hand."
197 [ -x sbin/chkconfig ]
199 sbin/chkconfig --add heartbeat
203 ###########################################################
205 ###########################################################
207 Uninstall_PPP_hack() {
208 file2hack=etc/ppp/ip-up.local
209 echo "NOTE: Restoring /$file2hack"
211 ed -s $file2hack <<-!EOF 2>/dev/null
221 [ -x sbin/chkconfig ] && sbin/chkconfig --del heartbeat
223 [ ! -x etc/ppp/ip-up.heart ]
229 [ -r etc/SuSE-release ]
231 rm -f sbin/init.d/rc[23]/*heartbeat