new version
[sahlberg/ctdb.git] / packaging / RPM / ctdb.spec
1 %define initdir %{_sysconfdir}/init.d
2
3 Summary: Clustered TDB
4 Vendor: Samba Team
5 Packager: Samba Team <samba@samba.org>
6 Name: ctdb
7 Version: 1.0
8 Release: 43
9 Epoch: 0
10 License: GNU GPL version 3
11 Group: System Environment/Daemons
12 URL: http://ctdb.samba.org/
13
14 Source: ctdb-%{version}.tar.gz
15
16 Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
17 Prereq: fileutils sed /etc/init.d
18
19 Provides: ctdb = %{version}
20
21 Prefix: /usr
22 BuildRoot: %{_tmppath}/%{name}-%{version}-root
23
24 %description
25 ctdb is the clustered database used by samba
26
27
28 #######################################################################
29
30 %prep
31 %setup -q
32 # setup the init script and sysconfig file
33 %setup -T -D -n ctdb-%{version} -q
34
35 %build
36
37 CC="gcc"
38
39 ## always run autogen.sh
40 ./autogen.sh
41
42 CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\"" ./configure \
43         --prefix=%{_prefix} \
44         --sysconfdir=%{_sysconfdir} \
45         --mandir=%{_mandir} \
46         --localstatedir="/var"
47
48 make showflags
49 make   
50
51 %install
52 # Clean up in case there is trash left from a previous build
53 rm -rf $RPM_BUILD_ROOT
54
55 # Create the target build directory hierarchy
56 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
57 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
58
59 make DESTDIR=$RPM_BUILD_ROOT install
60
61 install -m644 config/ctdb.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ctdb
62 install -m755 config/ctdb.init $RPM_BUILD_ROOT%{initdir}/ctdb
63
64 # Remove "*.old" files
65 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70 %post
71 [ -x /sbin/chkconfig ] && /sbin/chkconfig --add ctdb
72
73 %preun
74 if [ $1 = 0 ] ; then
75     [ -x /sbin/chkconfig ] && /sbin/chkconfig --del ctdb
76 fi
77 exit 0
78
79 %postun
80 if [ "$1" -ge "1" ]; then
81         %{initdir}/ctdb restart >/dev/null 2>&1
82 fi      
83
84
85 #######################################################################
86 ## Files section                                                     ##
87 #######################################################################
88
89 %files
90 %defattr(-,root,root)
91
92 %config(noreplace) %{_sysconfdir}/sysconfig/ctdb
93 %attr(755,root,root) %{initdir}/ctdb
94
95 %{_sysconfdir}/ctdb/functions
96 %{_sysconfdir}/ctdb/events.d/README
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
108 %{_sbindir}/ctdbd
109 %{_bindir}/ctdb
110 %{_bindir}/smnotify
111 %{_bindir}/ctdb_ipmux
112 %{_bindir}/ctdb_diagnostics
113 %{_bindir}/onnode.ssh
114 %{_bindir}/onnode.rsh
115 %{_bindir}/onnode
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
121
122 %changelog
123 * Tue Jul 1 2008 : Version 1.0.43
124  - Updates and bugfixes to the specfile to keep rpmlint happy
125  - Force a global flags update after each recovery event.
126  - Verify that the recmaster agrees with our node flags and update the
127    recmaster othervise.
128  - When writing back to the parent from a freeze-child across the pipe,
129    loop over the write in case the write failed with an error  othervise
130    the parent will never be notified tha the child has completed the operation.
131  - Automatically thaw all databases when recmaster marks us as being in normal
132    mode instead of recovery mode.
133 * Fri Jun 13 2008 : Version 1.0.42
134  - When event scripts have hung/timedout more than EventScriptBanCount times
135    in a row the node will ban itself.
136  - Many updates to persistent write tests and the test scripts.
137 * Wed May 28 2008 : Version 1.0.41
138  - Reactivate the safe writes to persistent databases and solve the
139    locking issues. Locking issues are solved the only possible way,
140    by using a child process to do the writes.  Expensive and slow but... . 
141 * Tue May 27 2008 : Version 1.0.40
142  - Read the samba sysconfig file from the 50.samba eventscript
143  - Fix some emmory hierarchical bugs in the persistent write handling
144 * Thu May 22 2008 : Version 1.0.39
145  - Moved a CTDB_MANAGES_NFS, CTDB_MANAGES_ISCSI and CTDB_MANAGES_CSFTPD
146    into /etc/sysconfig/ctdb
147  - Lowered some debug messages to not fill the logfile with entries
148    that normally occur in the default configuration.
149 * Fri May 16 2008 : Version 1.0.38
150  - Add machine readable output support to "ctdb getmonmode"
151  - Lots of tweaks and enhancements if the event scripts are "slow"
152  - Merge from tridge: an attempt to break the chicken-and-egg deadlock that
153    net conf introduces if used from an eventscript.
154  - Enhance tickles so we can tickle an ipv6 connection.
155  - Start adding ipv6 support : create a new container to replace sockaddr_in.
156  - Add a checksum routine for ipv6/tcp
157  - When starting up ctdb, let the init script do a tdbdump on all
158    persistent databases and verify that they are good (i.e. not corrupted).
159  - Try to use "safe transactions" when writing to a persistent database
160    that was opened with the TDB_NOSYNC flag. If we can get the transaction
161    thats great, if we cant  we have to write anyway since we cant block here.
162 * Mon May 12 2008 : Version 1.0.37
163  - When we shutdown ctdb we close the transport down before we run the 
164    "shutdown" eventscripts. If ctdb decides to send a packet to a remote node
165    after we have shutdown the transport but before we have shutdown ctdbd
166    itself this could lead to a SEGV instead of a clean shutdown. Fix.
167  - When using the "exportfs" command to extract which NFS export directories
168    to monitor,  exportfs violates the "principle of least surprise" and
169    sometimes report a single export line as two lines of text output
170    causing the monitoring to fail.
171 * Fri May 9 2008 : Version 1.0.36
172  - fix a memory corruption bug that could cause the recovery daemon to crash.
173  - fix a bug with distributing public ip addresses during recovery.
174    If the node that is the recovery master did NOT use public addresses,
175    then it assumed that no other node in the cluster used them either and
176    thus skipped the entire step of reallocating public addresses.
177 * Wed May 7 2008 : Version 1.0.35
178  - During recovery, when we define the new set of lmasters (vnnmap)
179    only consider those nodes that have the can-be-lmaster capability
180    when we create the vnnmap. unless there are no nodes available which
181    supports this capability in which case we allow the recmaster to
182    become lmaster capable (temporarily).
183  - Extend the async framework so that we can use paralell async calls
184    to controls that return data.
185  - If we do not have the "can be recmaster" capability, make sure we will
186    lose any recmaster elections, unless there are no nodes available that
187    have the capability, in which case we "take/win" the election anyway.
188  - Close and reopen the reclock pnn file at regular intervals.
189    Make it a non-fatal event if we occasionally fail to open/read/write
190    to this file.
191  - Monitor that the recovery daemon is still running from the main ctdb
192    daemon and shutdown the main daemon when recovery daemon has terminated.
193  - Add a "ctdb getcapabilities" command to read the capabilities off a node.
194  - Define two new capabilities : can be recmaster and can be lmaster
195    and default both capabilities to YES.
196  - Log denied tcp connection attempts with DEBUG_ERR and not DEBUG_WARNING
197 * Thu Apr 24 2008 : Version 1.0.34
198  - When deleting a public ip from a node, try to migrate the ip to a different
199    node first.
200  - Change catdb to produce output similar to tdbdump
201  - When adding a new public ip address, if this ip does not exist yet in
202    the cluster, then grab the ip on the local node and activate it.
203  - When a node disagrees with the recmaster on WHO is the recmaster, then
204    mark that node as a recovery culprit so it will eventually become
205    banned.
206  - Make ctdb eventscript support the -n all argument.
207 * Thu Apr 10 2008 : Version 1.0.33
208  - Add facilities to include site local adaptations to the eventscript
209    by /etc/ctdb/rc.local which will be read by all eventscripts.
210  - Add a "ctdb version" command.
211  - Secure the domain socket with proper permissions from Chris Cowan
212  - Bugfixes for AIX from Chris Cowan
213 * Wed Apr 02 2008 : Version 1.0.32
214  - Add a control to have a node execute the eventscripts with arbitrary
215    command line arguments.
216  - Add a control "rddumpmemory" that will dump the talloc memory allocations
217    for the recovery daemon.
218  - Decorate the talloc memdump to produce better and easier memory leak
219    tracking. 
220  - Update the RHEL5 iscsi tgtd scripts to allow one iscsi target for each
221    public address.
222  - Add two new controls "addip/delip" that can be used to add/remove public
223    addresses to a node at runtime. After using these controls a "ctdb recover"
224    ir required to make the changes take.
225  - Fix a couple of slow memory leaks.
226 * Tue Mar 25 2008 : Version 1.0.31
227  - Add back controls to disable/enable monitoring on a node.
228  - Fix a memory leak where we used to attach CALL data to the ctdb structure
229    when performing a local call. Memory which would be lost if the call was
230    aborted.
231  - Reduce the loglevel for the log output when someone connects to a non
232    public ip address for samba.
233  - Redo and optimize the vacuuming process to send only one control to each
234    other node containing all records to be vacuumed instead of one
235    control per node per record.
236 * Tue Mar 04 2008 : Version 1.0.30
237  - Update documentation cor new commands and tuneables
238  - Add machinereadable output to the ip,uptime and getdebug commands
239  - Add a moveip command to manually failover/failback public ips
240  - Add NoIPFallback tuneable that prevents ip address failback
241  - Use file locking inside the CFS as alternative to verify when other nodes
242    Are connected/disconnected to be able to recover from split network
243  - Add DisableWhenUnhealthy tunable
244  - Add CTDB_START_AS_DISABLED sysconfig param
245  - Add --start-as-disabled flag to ctdb
246  - Add ability to monitor for OOM condition
247 * Thu Feb 21 2008 : Version 1.0.29
248  - Add a new command to make expansion of an existing cluster easier
249  - Fix bug with references to freed objects in the ctdb structure
250  - Propagate debuglevel changes to the recovery daemon
251  - Merge patches to event scripts from Mathieu Parent :
252  - MP: Simulate "service" on systems which do not provide this tool
253  - MP: Set correct permissions for events.d/README
254  - Add nice helper functions to start/stop nfs from the event scripts
255 * Fri Feb 08 2008 : Version 1.0.28
256  - Fix a problem where we tried to use ethtool on non-ethernet interfaces
257  - Warn if the ipvsadm packege is missing when LVS is used
258  - Dont use absolute pathnames in some of the event scripts
259  - Fix for persistent tdbs growing inifinitely.
260 * Wed Feb 06 2008 : Version 1.0.27
261  - Add eventscript for iscsi
262 * Thu Jan 31 2008 : Version 1.0.26
263  - Fix crashbug in tdb transaction code
264 * Tue Jan 29 2008 : Version 1.0.25
265  - added async recovery code
266  - make event scripts more portable
267  - fixed ctdb dumpmemory
268  - more efficient tdb allocation code
269  - improved machine readable ctdb status output
270  - added ctdb uptime
271 * Wed Jan 16 2008 : Version 1.0.24
272  - added syslog support
273  - documentation updates
274 * Wed Jan 16 2008 : Version 1.0.23
275  - fixed a memory leak in the recoveryd
276  - fixed a corruption bug in the new transaction code
277  - fixed a case where an packet for a disconnected client could be processed
278  - added http event script
279  - updated documentation
280 * Thu Jan 10 2008 : Version 1.0.22
281  - auto-run vacuum and repack ops
282 * Wed Jan 09 2008 : Version 1.0.21
283  - added ctdb vacuum and ctdb repack code
284 * Sun Jan 06 2008 : Version 1.0.20
285  - new transaction based recovery code
286 * Sat Jan 05 2008 : Version 1.0.19
287  - fixed non-master bug
288  - big speedup in recovery for large databases
289  - lots of changes to improve tdb and ctdb for high churn databases
290 * Thu Dec 27 2007 : Version 1.0.18
291  - fixed crash bug in monitor_handler
292 * Tue Dec 04 2007 : Version 1.0.17
293  - fixed bugs related to ban/unban of nodes
294  - fixed a race condition that could lead to monitoring being permanently disabled,
295    which would lead to long recovery times
296  - make deterministic IPs the default
297  - fixed a bug related to continuous recovery 
298  - added a debugging option --node-ip