1 %define initdir %{_sysconfdir}/init.d
5 Packager: Samba Team <samba@samba.org>
10 License: GNU GPL version 3
11 Group: System Environment/Daemons
12 URL: http://ctdb.samba.org/
14 Source: ctdb-%{version}.tar.gz
16 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
17 Prereq: fileutils sed /etc/init.d
19 Provides: ctdb = %{version}
22 BuildRoot: %{_tmppath}/%{name}-%{version}-root
25 ctdb is the clustered database used by samba
28 #######################################################################
32 # setup the init script and sysconfig file
33 %setup -T -D -n ctdb-%{version} -q
39 ## always run autogen.sh
42 CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\"" ./configure \
44 --sysconfdir=%{_sysconfdir} \
46 --localstatedir="/var"
52 # Clean up in case there is trash left from a previous build
53 rm -rf $RPM_BUILD_ROOT
55 # Create the target build directory hierarchy
56 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
57 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
59 make DESTDIR=$RPM_BUILD_ROOT install
61 install -m644 config/ctdb.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
62 install -m755 config/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
64 # Remove "*.old" files
65 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
68 rm -rf $RPM_BUILD_ROOT
71 [ -x /sbin/chkconfig ] && /sbin/chkconfig --add ctdb
75 [ -x /sbin/chkconfig ] && /sbin/chkconfig --del ctdb
80 if [ "$1" -ge "1" ]; then
81 %{initdir}/ctdb restart >/dev/null 2>&1 || true
85 #######################################################################
87 #######################################################################
92 %config(noreplace) %{_sysconfdir}/sysconfig/ctdb
93 %config(noreplace) %{_sysconfdir}/ctdb/functions
94 %attr(755,root,root) %{initdir}/ctdb
96 %{_docdir}/ctdb/README.eventscripts
97 %{_sysconfdir}/ctdb/events.d/00.ctdb
98 %{_sysconfdir}/ctdb/events.d/10.interface
99 %{_sysconfdir}/ctdb/events.d/20.multipathd
100 %{_sysconfdir}/ctdb/events.d/40.vsftpd
101 %{_sysconfdir}/ctdb/events.d/41.httpd
102 %{_sysconfdir}/ctdb/events.d/50.samba
103 %{_sysconfdir}/ctdb/events.d/60.nfs
104 %{_sysconfdir}/ctdb/events.d/61.nfstickle
105 %{_sysconfdir}/ctdb/events.d/70.iscsi
106 %{_sysconfdir}/ctdb/events.d/90.ipmux
107 %{_sysconfdir}/ctdb/events.d/91.lvs
108 %{_sysconfdir}/ctdb/events.d/99.routing
109 %{_sysconfdir}/ctdb/statd-callout
113 %{_bindir}/ctdb_ipmux
114 %{_bindir}/ctdb_diagnostics
116 %{_mandir}/man1/ctdb.1.gz
117 %{_mandir}/man1/ctdbd.1.gz
118 %{_mandir}/man1/onnode.1.gz
119 %{_includedir}/ctdb.h
120 %{_includedir}/ctdb_private.h
123 * Mon Oct 22 2008 : Version 1.0.64
124 - Add a context and a timed event so that once we have been in recovery for
125 too long we drop all public addresses.
126 * Mon Oct 20 2008 : Version 1.0.63
127 - Remove logging of "periodic cleanup ..." in 50.samba
128 - When we reload a nodes file, we must detect this and reload the file also
129 in the recovery daemon before we try to dereference somethoung beyond the end
131 * Thu Oct 16 2008 : Version 1.0.62
132 - Allow multiple eventscritps using the same prefix number.
133 It is undefined which order scripts with the same prefix will execute in.
134 * Wed Oct 15 2008 : Version 1.0.61
135 - Use "route add -net" instead of "ip route add" when adding routes in 99.routing
136 - lower the loglevel os several debug statements
137 - check the status returned from ctdb_ctrl_get_tickles() before we try to print them out to the screen.
138 - install a new eventscript 20.multipathd whoich can be used to monitor that multipath devices are healthy
139 * Wed Oct 15 2008 : Version 1.0.60
140 - Verify that nodes we try to ban/unban are reachable and print an error othervise.
141 - Update the client and server sides of TAKEIP/RELEASEIP/GETPUBLICIPS and GETNODEMAP to fall back to the old style ipv4-only controls if the new ipv4/ipv6 controls fail. This allows an ipv4/v6 enabled ctdb daemon to interoperate with earlier ipv4-only versions of the daemons.
142 - From Mathieu Parent : log debian systems log the package versions in ctdb diagnostics
143 - From Mathieu Parent : specify logdir location for debian (this patch was later reversed)
144 - From Michael Adams : allow # comments in nodes/public_addresses files
145 * Tue Oct 7 2008 : Version 1.0.59
146 - Updated "reloadnodes" logic. Instead of bouncing the entire tcp layer it is sufficient to just close and reopen all outgoing tcp connections.
147 - New eventscript 99.routing which can be used to re-attach routes to public interfaces after a takeip event. (routes may be deleted by the kernel when we release an ip)
148 - IDR tree fix from Jim Houston
149 - Better handling of critical events if the local clock is suddenly changed forward by a lot.
150 - Fix three slow memory leaks in the recovery daemon
151 - New ctdb command : ctdb recmaster which prints the pnn of the recmaster
152 - Onnode enhancements from Martin S : "healthy" and "connected" are now possible nodespecifiers
153 - From Martin S : doc fixes
154 - lowering some debug levels for some nonvital informational messages
155 - Make the daemon daemon monitoring stronger and allow ctdbd to detect a hung
157 - From C Cowan : patches to compile ipv6 under AIX
158 - zero out some structs to keep valgrind happy
159 * Wed Aug 27 2008 : Version 1.0.58
160 - revert the name change tcp_tcp_client back to tcp_control_tcp so
162 - Updates to the init script from Abhijith Das <adas@redhat.com>
163 * Mon Aug 25 2008 : Version 1.0.57
164 - initial support for IPv6
165 * Mon Aug 11 2008 : Version 1.0.56
166 - fix a memory leak in the recovery daemon.
167 * Mon Aug 11 2008 : Version 1.0.55
168 - Fix the releaseip message we seond to samba.
169 * Fri Aug 8 2008 : Version 1.0.54
170 - fix a looping error in the transaction code
171 - provide a more detailed error code for persistent store errors
172 so clients can make more intelligent choices on how to try to recover
173 * Thu Aug 7 2008 : Version 1.0.53
174 - Remove the reclock.pnn file it can cause gpfs to fail to umount
175 - New transaction code
176 * Mon Aug 4 2008 : Version 1.0.52
177 - Send an explicit gratious arp when starting sending the tcp tickles.
178 - When doing failover, issue a killtcp to non-NFS/non-CIFS clients
179 so that they fail quickly. NFS and CIFS already fail and recover
181 - Update the test scripts to handle CTRL-C to kill off the test.
182 * Mon Jul 28 2008 : Version 1.0.51
183 - Strip off the vlan tag from bond devices before we check in /proc
184 if the interface is up or not.
185 - Use testparm in the background in the scripts to allow probing
186 that the shares do exist.
187 - Fix a bug in the logging code to handle multiline entries better
188 - Rename private elements from private to private_data
189 * Fri Jul 18 2008 : Version 1.0.50
190 - Dont assume that just because we can establish a TCP connection
191 that we are actually talking to a functioning ctdb daemon.
192 So dont mark the node as CONNECTED just because the tcp handshake
194 - Dont try to set the recmaster to ourself during elections for those
195 cases we know this will fail. To remove some annoying benign but scary
196 looking entries from the log.
197 - Bugfix for eventsystem for signal handling that could cause a node to
199 * Thu Jul 17 2008 : Version 1.0.49
200 - Update the safe persistent update fix to work with unpatched samba
202 * Thu Jul 17 2008 : Version 1.0.48
203 - Update the spec file.
204 - Do not start new user-triggered eventscripts if we are already
205 inside recovery mode.
206 - Add two new controls to start/cancel a persistent update.
207 A client such as samba can use these to tell ctdbd that it will soon
208 be writing directly to the persistent database tdb file. So if
209 samba is -9ed before it has eitehr done the persistent_store or
210 canceled the operation, ctdb knows that the persistent databases
211 'may' be out of sync and therefore a full blown recovery is called for.
212 - Add two new options :
213 CTDB_SAMBA_SKIP_CONF_CHECK and CTDB_SAMBA_CHECK_PORTS that can be used
214 to override what checks to do when monitoring samba health.
215 We can no longer use the smbstatus, net or testparm commands to check
216 if samba or its config is healthy since these commands may block
217 indefinitely and thus can not be used in scripts.
218 * Fri Jul 11 2008 : Version 1.0.47
219 - Fix a double free bug where if a user striggered (ctdb eventscript)
220 hung and while the timeout handler was being processed a new user
221 triggered eventscript was started we would free state twice.
222 - Rewrite of onnode and associated documentation.
223 * Thu Jul 10 2008 : Version 1.0.46
224 - Document both the LVS:cingle-ip-address and the REMOTE-NODE:wan-accelerator
226 - Add commands "ctdb pnn", "ctdb lvs", "ctdb lvsmaster".
227 - LVS improvements. LVS is the single-ip-address mode for a ctdb cluster.
228 - Fixes to supress rpmlint warnings
230 - Change \s to [[:space:]] in some scripts. Not all RHEL5 packages come
231 with a egrep that handles \s even same version but different arch.
232 - Revert the change to NFS restart. CTDB should NOT attempt to restart
234 - Rewrite of the waitpid() patch to use the eventsystem for handling
236 * Tue Jul 8 2008 : Version 1.0.45
237 - Try to restart the nfs service if it has failed to respond 3 times in a row.
238 - waitpid() can block if the child does not respond promptly to SIGTERM.
239 ignore all SIGCHILD signals by setting SIGCHLD to SIG_DEF.
240 get rid of all calls to waitpid().
241 - make handling of eventscripts hanging more liberal.
242 only consider the script to have failed and making the node unhealthy
243 IF the eventscript terminated wiht an error
244 OR the eventscript hung 5 or more times in a row
245 * Mon Jul 7 2008 : Version 1.0.44
246 - Add a CTDB_VALGRIND option to /etc/sysconfig/ctdb to make it start
247 ctdb under valgrind. Logs go to /var/log/ctdb_valgrind.PID
248 - Add a hack to show the control opcode that caused uninitialized data
249 in the valgrind output by encoding the opcode as the line number.
250 - Initialize structures and allocated memory in various places in
251 ctdb to make it valgrind-clean and remove all valgrind errors/warnings.
252 - If/when we destroy a lockwait child, also make sure we cancel any pending transactions
253 - If a transaction_commit fails, delete/cancel any pending transactions and
254 return an error instead of calling ctdb_fatal()
255 - When running ctdb under valgrind, make sure we run it with --nosetsched and also
256 ensure that we do not use mem-mapped i/o when accessing the tdb's.
257 - zero out ctdb->freeze_handle when we free/destroy a freeze-child.
258 This prevent a heap corruption/ctdb crash bug that could trigger
259 if the freeze child times out.
260 - we dont need to explicitely thaw the databases from the recovery daemon
261 since this is done implicitely when we restore the recovery mode back to normal.
262 - track when we start and stop a recovery. Add the 'time it took to complete the
263 recovery' to the 'ctdb uptime' output.
264 Ensure by tracking the start/stop recovery timestamps that we do not
265 check that the ip allocation is consistend from inside the recovery daemon
266 while a different node (recovery master) is performing a recovery.
267 This prevent a race that could cause a full recovery to trigger if the
268 'ctdb disable/enable' commands took very long.
269 - The freeze child indicates to the master daemon that all databases are locked
270 by writing data to the pipe shared with the master daemon.
271 This write sometimes fail and thus the master daemon never notices that the databases
272 are locked cvausing long timeouts and extra recoveries.
273 Check that the write is successful and try the write again if it failed.
274 - In each node, verify that the recmaster have the right node flags for us
275 and force a push of our flags to the recmaster if wrong.
276 * Tue Jul 1 2008 : Version 1.0.43
277 - Updates and bugfixes to the specfile to keep rpmlint happy
278 - Force a global flags update after each recovery event.
279 - Verify that the recmaster agrees with our node flags and update the
281 - When writing back to the parent from a freeze-child across the pipe,
282 loop over the write in case the write failed with an error othervise
283 the parent will never be notified tha the child has completed the operation.
284 - Automatically thaw all databases when recmaster marks us as being in normal
285 mode instead of recovery mode.
286 * Fri Jun 13 2008 : Version 1.0.42
287 - When event scripts have hung/timedout more than EventScriptBanCount times
288 in a row the node will ban itself.
289 - Many updates to persistent write tests and the test scripts.
290 * Wed May 28 2008 : Version 1.0.41
291 - Reactivate the safe writes to persistent databases and solve the
292 locking issues. Locking issues are solved the only possible way,
293 by using a child process to do the writes. Expensive and slow but... .
294 * Tue May 27 2008 : Version 1.0.40
295 - Read the samba sysconfig file from the 50.samba eventscript
296 - Fix some emmory hierarchical bugs in the persistent write handling
297 * Thu May 22 2008 : Version 1.0.39
298 - Moved a CTDB_MANAGES_NFS, CTDB_MANAGES_ISCSI and CTDB_MANAGES_CSFTPD
299 into /etc/sysconfig/ctdb
300 - Lowered some debug messages to not fill the logfile with entries
301 that normally occur in the default configuration.
302 * Fri May 16 2008 : Version 1.0.38
303 - Add machine readable output support to "ctdb getmonmode"
304 - Lots of tweaks and enhancements if the event scripts are "slow"
305 - Merge from tridge: an attempt to break the chicken-and-egg deadlock that
306 net conf introduces if used from an eventscript.
307 - Enhance tickles so we can tickle an ipv6 connection.
308 - Start adding ipv6 support : create a new container to replace sockaddr_in.
309 - Add a checksum routine for ipv6/tcp
310 - When starting up ctdb, let the init script do a tdbdump on all
311 persistent databases and verify that they are good (i.e. not corrupted).
312 - Try to use "safe transactions" when writing to a persistent database
313 that was opened with the TDB_NOSYNC flag. If we can get the transaction
314 thats great, if we cant we have to write anyway since we cant block here.
315 * Mon May 12 2008 : Version 1.0.37
316 - When we shutdown ctdb we close the transport down before we run the
317 "shutdown" eventscripts. If ctdb decides to send a packet to a remote node
318 after we have shutdown the transport but before we have shutdown ctdbd
319 itself this could lead to a SEGV instead of a clean shutdown. Fix.
320 - When using the "exportfs" command to extract which NFS export directories
321 to monitor, exportfs violates the "principle of least surprise" and
322 sometimes report a single export line as two lines of text output
323 causing the monitoring to fail.
324 * Fri May 9 2008 : Version 1.0.36
325 - fix a memory corruption bug that could cause the recovery daemon to crash.
326 - fix a bug with distributing public ip addresses during recovery.
327 If the node that is the recovery master did NOT use public addresses,
328 then it assumed that no other node in the cluster used them either and
329 thus skipped the entire step of reallocating public addresses.
330 * Wed May 7 2008 : Version 1.0.35
331 - During recovery, when we define the new set of lmasters (vnnmap)
332 only consider those nodes that have the can-be-lmaster capability
333 when we create the vnnmap. unless there are no nodes available which
334 supports this capability in which case we allow the recmaster to
335 become lmaster capable (temporarily).
336 - Extend the async framework so that we can use paralell async calls
337 to controls that return data.
338 - If we do not have the "can be recmaster" capability, make sure we will
339 lose any recmaster elections, unless there are no nodes available that
340 have the capability, in which case we "take/win" the election anyway.
341 - Close and reopen the reclock pnn file at regular intervals.
342 Make it a non-fatal event if we occasionally fail to open/read/write
344 - Monitor that the recovery daemon is still running from the main ctdb
345 daemon and shutdown the main daemon when recovery daemon has terminated.
346 - Add a "ctdb getcapabilities" command to read the capabilities off a node.
347 - Define two new capabilities : can be recmaster and can be lmaster
348 and default both capabilities to YES.
349 - Log denied tcp connection attempts with DEBUG_ERR and not DEBUG_WARNING
350 * Thu Apr 24 2008 : Version 1.0.34
351 - When deleting a public ip from a node, try to migrate the ip to a different
353 - Change catdb to produce output similar to tdbdump
354 - When adding a new public ip address, if this ip does not exist yet in
355 the cluster, then grab the ip on the local node and activate it.
356 - When a node disagrees with the recmaster on WHO is the recmaster, then
357 mark that node as a recovery culprit so it will eventually become
359 - Make ctdb eventscript support the -n all argument.
360 * Thu Apr 10 2008 : Version 1.0.33
361 - Add facilities to include site local adaptations to the eventscript
362 by /etc/ctdb/rc.local which will be read by all eventscripts.
363 - Add a "ctdb version" command.
364 - Secure the domain socket with proper permissions from Chris Cowan
365 - Bugfixes for AIX from Chris Cowan
366 * Wed Apr 02 2008 : Version 1.0.32
367 - Add a control to have a node execute the eventscripts with arbitrary
368 command line arguments.
369 - Add a control "rddumpmemory" that will dump the talloc memory allocations
370 for the recovery daemon.
371 - Decorate the talloc memdump to produce better and easier memory leak
373 - Update the RHEL5 iscsi tgtd scripts to allow one iscsi target for each
375 - Add two new controls "addip/delip" that can be used to add/remove public
376 addresses to a node at runtime. After using these controls a "ctdb recover"
377 ir required to make the changes take.
378 - Fix a couple of slow memory leaks.
379 * Tue Mar 25 2008 : Version 1.0.31
380 - Add back controls to disable/enable monitoring on a node.
381 - Fix a memory leak where we used to attach CALL data to the ctdb structure
382 when performing a local call. Memory which would be lost if the call was
384 - Reduce the loglevel for the log output when someone connects to a non
385 public ip address for samba.
386 - Redo and optimize the vacuuming process to send only one control to each
387 other node containing all records to be vacuumed instead of one
388 control per node per record.
389 * Tue Mar 04 2008 : Version 1.0.30
390 - Update documentation cor new commands and tuneables
391 - Add machinereadable output to the ip,uptime and getdebug commands
392 - Add a moveip command to manually failover/failback public ips
393 - Add NoIPFallback tuneable that prevents ip address failback
394 - Use file locking inside the CFS as alternative to verify when other nodes
395 Are connected/disconnected to be able to recover from split network
396 - Add DisableWhenUnhealthy tunable
397 - Add CTDB_START_AS_DISABLED sysconfig param
398 - Add --start-as-disabled flag to ctdb
399 - Add ability to monitor for OOM condition
400 * Thu Feb 21 2008 : Version 1.0.29
401 - Add a new command to make expansion of an existing cluster easier
402 - Fix bug with references to freed objects in the ctdb structure
403 - Propagate debuglevel changes to the recovery daemon
404 - Merge patches to event scripts from Mathieu Parent :
405 - MP: Simulate "service" on systems which do not provide this tool
406 - MP: Set correct permissions for events.d/README
407 - Add nice helper functions to start/stop nfs from the event scripts
408 * Fri Feb 08 2008 : Version 1.0.28
409 - Fix a problem where we tried to use ethtool on non-ethernet interfaces
410 - Warn if the ipvsadm packege is missing when LVS is used
411 - Dont use absolute pathnames in some of the event scripts
412 - Fix for persistent tdbs growing inifinitely.
413 * Wed Feb 06 2008 : Version 1.0.27
414 - Add eventscript for iscsi
415 * Thu Jan 31 2008 : Version 1.0.26
416 - Fix crashbug in tdb transaction code
417 * Tue Jan 29 2008 : Version 1.0.25
418 - added async recovery code
419 - make event scripts more portable
420 - fixed ctdb dumpmemory
421 - more efficient tdb allocation code
422 - improved machine readable ctdb status output
424 * Wed Jan 16 2008 : Version 1.0.24
425 - added syslog support
426 - documentation updates
427 * Wed Jan 16 2008 : Version 1.0.23
428 - fixed a memory leak in the recoveryd
429 - fixed a corruption bug in the new transaction code
430 - fixed a case where an packet for a disconnected client could be processed
431 - added http event script
432 - updated documentation
433 * Thu Jan 10 2008 : Version 1.0.22
434 - auto-run vacuum and repack ops
435 * Wed Jan 09 2008 : Version 1.0.21
436 - added ctdb vacuum and ctdb repack code
437 * Sun Jan 06 2008 : Version 1.0.20
438 - new transaction based recovery code
439 * Sat Jan 05 2008 : Version 1.0.19
440 - fixed non-master bug
441 - big speedup in recovery for large databases
442 - lots of changes to improve tdb and ctdb for high churn databases
443 * Thu Dec 27 2007 : Version 1.0.18
444 - fixed crash bug in monitor_handler
445 * Tue Dec 04 2007 : Version 1.0.17
446 - fixed bugs related to ban/unban of nodes
447 - fixed a race condition that could lead to monitoring being permanently disabled,
448 which would lead to long recovery times
449 - make deterministic IPs the default
450 - fixed a bug related to continuous recovery
451 - added a debugging option --node-ip