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
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/40.vsftpd
100 %{_sysconfdir}/ctdb/events.d/41.httpd
101 %{_sysconfdir}/ctdb/events.d/50.samba
102 %{_sysconfdir}/ctdb/events.d/60.nfs
103 %{_sysconfdir}/ctdb/events.d/61.nfstickle
104 %{_sysconfdir}/ctdb/events.d/70.iscsi
105 %{_sysconfdir}/ctdb/events.d/90.ipmux
106 %{_sysconfdir}/ctdb/events.d/91.lvs
107 %{_sysconfdir}/ctdb/statd-callout
111 %{_bindir}/ctdb_ipmux
112 %{_bindir}/ctdb_diagnostics
113 %{_bindir}/onnode.ssh
114 %{_bindir}/onnode.rsh
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 * Tue Jul 8 2008 : Version 1.0.45
124 - Try to restart the nfs service if it has failed to respond 3 times in a row.
125 - waitpid() can block if the child does not respond promptly to SIGTERM.
126 ignore all SIGCHILD signals by setting SIGCHLD to SIG_DEF.
127 get rid of all calls to waitpid().
128 - make handling of eventscripts hanging more liberal.
129 only consider the script to have failed and making the node unhealthy
130 IF the eventscript terminated wiht an error
131 OR the eventscript hung 5 or more times in a row
132 * Mon Jul 7 2008 : Version 1.0.44
133 - Add a CTDB_VALGRIND option to /etc/sysconfig/ctdb to make it start
134 ctdb under valgrind. Logs go to /var/log/ctdb_valgrind.PID
135 - Add a hack to show the control opcode that caused uninitialized data
136 in the valgrind output by encoding the opcode as the line number.
137 - Initialize structures and allocated memory in various places in
138 ctdb to make it valgrind-clean and remove all valgrind errors/warnings.
139 - If/when we destroy a lockwait child, also make sure we cancel any pending transactions
140 - If a transaction_commit fails, delete/cancel any pending transactions and
141 return an error instead of calling ctdb_fatal()
142 - When running ctdb under valgrind, make sure we run it with --nosetsched and also
143 ensure that we do not use mem-mapped i/o when accessing the tdb's.
144 - zero out ctdb->freeze_handle when we free/destroy a freeze-child.
145 This prevent a heap corruption/ctdb crash bug that could trigger
146 if the freeze child times out.
147 - we dont need to explicitely thaw the databases from the recovery daemon
148 since this is done implicitely when we restore the recovery mode back to normal.
149 - track when we start and stop a recovery. Add the 'time it took to complete the
150 recovery' to the 'ctdb uptime' output.
151 Ensure by tracking the start/stop recovery timestamps that we do not
152 check that the ip allocation is consistend from inside the recovery daemon
153 while a different node (recovery master) is performing a recovery.
154 This prevent a race that could cause a full recovery to trigger if the
155 'ctdb disable/enable' commands took very long.
156 - The freeze child indicates to the master daemon that all databases are locked
157 by writing data to the pipe shared with the master daemon.
158 This write sometimes fail and thus the master daemon never notices that the databases
159 are locked cvausing long timeouts and extra recoveries.
160 Check that the write is successful and try the write again if it failed.
161 - In each node, verify that the recmaster have the right node flags for us
162 and force a push of our flags to the recmaster if wrong.
163 * Tue Jul 1 2008 : Version 1.0.43
164 - Updates and bugfixes to the specfile to keep rpmlint happy
165 - Force a global flags update after each recovery event.
166 - Verify that the recmaster agrees with our node flags and update the
168 - When writing back to the parent from a freeze-child across the pipe,
169 loop over the write in case the write failed with an error othervise
170 the parent will never be notified tha the child has completed the operation.
171 - Automatically thaw all databases when recmaster marks us as being in normal
172 mode instead of recovery mode.
173 * Fri Jun 13 2008 : Version 1.0.42
174 - When event scripts have hung/timedout more than EventScriptBanCount times
175 in a row the node will ban itself.
176 - Many updates to persistent write tests and the test scripts.
177 * Wed May 28 2008 : Version 1.0.41
178 - Reactivate the safe writes to persistent databases and solve the
179 locking issues. Locking issues are solved the only possible way,
180 by using a child process to do the writes. Expensive and slow but... .
181 * Tue May 27 2008 : Version 1.0.40
182 - Read the samba sysconfig file from the 50.samba eventscript
183 - Fix some emmory hierarchical bugs in the persistent write handling
184 * Thu May 22 2008 : Version 1.0.39
185 - Moved a CTDB_MANAGES_NFS, CTDB_MANAGES_ISCSI and CTDB_MANAGES_CSFTPD
186 into /etc/sysconfig/ctdb
187 - Lowered some debug messages to not fill the logfile with entries
188 that normally occur in the default configuration.
189 * Fri May 16 2008 : Version 1.0.38
190 - Add machine readable output support to "ctdb getmonmode"
191 - Lots of tweaks and enhancements if the event scripts are "slow"
192 - Merge from tridge: an attempt to break the chicken-and-egg deadlock that
193 net conf introduces if used from an eventscript.
194 - Enhance tickles so we can tickle an ipv6 connection.
195 - Start adding ipv6 support : create a new container to replace sockaddr_in.
196 - Add a checksum routine for ipv6/tcp
197 - When starting up ctdb, let the init script do a tdbdump on all
198 persistent databases and verify that they are good (i.e. not corrupted).
199 - Try to use "safe transactions" when writing to a persistent database
200 that was opened with the TDB_NOSYNC flag. If we can get the transaction
201 thats great, if we cant we have to write anyway since we cant block here.
202 * Mon May 12 2008 : Version 1.0.37
203 - When we shutdown ctdb we close the transport down before we run the
204 "shutdown" eventscripts. If ctdb decides to send a packet to a remote node
205 after we have shutdown the transport but before we have shutdown ctdbd
206 itself this could lead to a SEGV instead of a clean shutdown. Fix.
207 - When using the "exportfs" command to extract which NFS export directories
208 to monitor, exportfs violates the "principle of least surprise" and
209 sometimes report a single export line as two lines of text output
210 causing the monitoring to fail.
211 * Fri May 9 2008 : Version 1.0.36
212 - fix a memory corruption bug that could cause the recovery daemon to crash.
213 - fix a bug with distributing public ip addresses during recovery.
214 If the node that is the recovery master did NOT use public addresses,
215 then it assumed that no other node in the cluster used them either and
216 thus skipped the entire step of reallocating public addresses.
217 * Wed May 7 2008 : Version 1.0.35
218 - During recovery, when we define the new set of lmasters (vnnmap)
219 only consider those nodes that have the can-be-lmaster capability
220 when we create the vnnmap. unless there are no nodes available which
221 supports this capability in which case we allow the recmaster to
222 become lmaster capable (temporarily).
223 - Extend the async framework so that we can use paralell async calls
224 to controls that return data.
225 - If we do not have the "can be recmaster" capability, make sure we will
226 lose any recmaster elections, unless there are no nodes available that
227 have the capability, in which case we "take/win" the election anyway.
228 - Close and reopen the reclock pnn file at regular intervals.
229 Make it a non-fatal event if we occasionally fail to open/read/write
231 - Monitor that the recovery daemon is still running from the main ctdb
232 daemon and shutdown the main daemon when recovery daemon has terminated.
233 - Add a "ctdb getcapabilities" command to read the capabilities off a node.
234 - Define two new capabilities : can be recmaster and can be lmaster
235 and default both capabilities to YES.
236 - Log denied tcp connection attempts with DEBUG_ERR and not DEBUG_WARNING
237 * Thu Apr 24 2008 : Version 1.0.34
238 - When deleting a public ip from a node, try to migrate the ip to a different
240 - Change catdb to produce output similar to tdbdump
241 - When adding a new public ip address, if this ip does not exist yet in
242 the cluster, then grab the ip on the local node and activate it.
243 - When a node disagrees with the recmaster on WHO is the recmaster, then
244 mark that node as a recovery culprit so it will eventually become
246 - Make ctdb eventscript support the -n all argument.
247 * Thu Apr 10 2008 : Version 1.0.33
248 - Add facilities to include site local adaptations to the eventscript
249 by /etc/ctdb/rc.local which will be read by all eventscripts.
250 - Add a "ctdb version" command.
251 - Secure the domain socket with proper permissions from Chris Cowan
252 - Bugfixes for AIX from Chris Cowan
253 * Wed Apr 02 2008 : Version 1.0.32
254 - Add a control to have a node execute the eventscripts with arbitrary
255 command line arguments.
256 - Add a control "rddumpmemory" that will dump the talloc memory allocations
257 for the recovery daemon.
258 - Decorate the talloc memdump to produce better and easier memory leak
260 - Update the RHEL5 iscsi tgtd scripts to allow one iscsi target for each
262 - Add two new controls "addip/delip" that can be used to add/remove public
263 addresses to a node at runtime. After using these controls a "ctdb recover"
264 ir required to make the changes take.
265 - Fix a couple of slow memory leaks.
266 * Tue Mar 25 2008 : Version 1.0.31
267 - Add back controls to disable/enable monitoring on a node.
268 - Fix a memory leak where we used to attach CALL data to the ctdb structure
269 when performing a local call. Memory which would be lost if the call was
271 - Reduce the loglevel for the log output when someone connects to a non
272 public ip address for samba.
273 - Redo and optimize the vacuuming process to send only one control to each
274 other node containing all records to be vacuumed instead of one
275 control per node per record.
276 * Tue Mar 04 2008 : Version 1.0.30
277 - Update documentation cor new commands and tuneables
278 - Add machinereadable output to the ip,uptime and getdebug commands
279 - Add a moveip command to manually failover/failback public ips
280 - Add NoIPFallback tuneable that prevents ip address failback
281 - Use file locking inside the CFS as alternative to verify when other nodes
282 Are connected/disconnected to be able to recover from split network
283 - Add DisableWhenUnhealthy tunable
284 - Add CTDB_START_AS_DISABLED sysconfig param
285 - Add --start-as-disabled flag to ctdb
286 - Add ability to monitor for OOM condition
287 * Thu Feb 21 2008 : Version 1.0.29
288 - Add a new command to make expansion of an existing cluster easier
289 - Fix bug with references to freed objects in the ctdb structure
290 - Propagate debuglevel changes to the recovery daemon
291 - Merge patches to event scripts from Mathieu Parent :
292 - MP: Simulate "service" on systems which do not provide this tool
293 - MP: Set correct permissions for events.d/README
294 - Add nice helper functions to start/stop nfs from the event scripts
295 * Fri Feb 08 2008 : Version 1.0.28
296 - Fix a problem where we tried to use ethtool on non-ethernet interfaces
297 - Warn if the ipvsadm packege is missing when LVS is used
298 - Dont use absolute pathnames in some of the event scripts
299 - Fix for persistent tdbs growing inifinitely.
300 * Wed Feb 06 2008 : Version 1.0.27
301 - Add eventscript for iscsi
302 * Thu Jan 31 2008 : Version 1.0.26
303 - Fix crashbug in tdb transaction code
304 * Tue Jan 29 2008 : Version 1.0.25
305 - added async recovery code
306 - make event scripts more portable
307 - fixed ctdb dumpmemory
308 - more efficient tdb allocation code
309 - improved machine readable ctdb status output
311 * Wed Jan 16 2008 : Version 1.0.24
312 - added syslog support
313 - documentation updates
314 * Wed Jan 16 2008 : Version 1.0.23
315 - fixed a memory leak in the recoveryd
316 - fixed a corruption bug in the new transaction code
317 - fixed a case where an packet for a disconnected client could be processed
318 - added http event script
319 - updated documentation
320 * Thu Jan 10 2008 : Version 1.0.22
321 - auto-run vacuum and repack ops
322 * Wed Jan 09 2008 : Version 1.0.21
323 - added ctdb vacuum and ctdb repack code
324 * Sun Jan 06 2008 : Version 1.0.20
325 - new transaction based recovery code
326 * Sat Jan 05 2008 : Version 1.0.19
327 - fixed non-master bug
328 - big speedup in recovery for large databases
329 - lots of changes to improve tdb and ctdb for high churn databases
330 * Thu Dec 27 2007 : Version 1.0.18
331 - fixed crash bug in monitor_handler
332 * Tue Dec 04 2007 : Version 1.0.17
333 - fixed bugs related to ban/unban of nodes
334 - fixed a race condition that could lead to monitoring being permanently disabled,
335 which would lead to long recovery times
336 - make deterministic IPs the default
337 - fixed a bug related to continuous recovery
338 - added a debugging option --node-ip