summaryrefslogtreecommitdiffstats
path: root/ctdb
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb: Rename CTDB_VERSION to CTDB_PROTOCOLAmitay Isaacs2014-10-285-9/+9
| | | | | | | CTDB_VERSION really is the ctdb protocol version. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb: Rename ctdb socket variable from CTDB_PATH to CTDB_SOCKETAmitay Isaacs2014-10-283-4/+4
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdb-logging: Add logging via UDP logging using RFC5424Martin Schwenke2014-10-284-4/+82
| | | | | | | | Some implementations may not understand RC3164 format messages on the UDP socket, so add support for RFC5424 message format. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Add logging via UDP to 127.0.0.1:514 to syslog backendMartin Schwenke2014-10-285-8/+98
| | | | | | | | | This has most of the advantages of the old logd with none of the complexity of the extra process. There are several good syslog implementations that can listen on the UDP port. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Add non-blocking Unix domain logging to syslog backendMartin Schwenke2014-10-284-8/+193
| | | | | | | Format messages as per RFC3164. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOGMartin Schwenke2014-10-2815-75/+177
| | | | | | | | | | | | Remove --logfile and --syslog daemon options and replace with --logging. Modularise and clean up logging initialisation code. The initialisation API includes an app_name argument that is currently unused - this will be used in extensions to the syslog backend. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Replace logd code with a basic syslog(3) implementationMartin Schwenke2014-10-284-224/+10
| | | | | | | | | | | | | | It is much simpler for most cases to have a syslog backend that doesn't need a separate CTDB-specific logging daemon. This loses the lossy, non-blocking mode provided by logd. However, a corresponding feature with a completely different implemention (not requiring an extra daemon) will be re-added into the syslog backend. In an ideal world the new implementation would be added first but unfortunately that is hard to do because the logd code is hooked in at more than one place. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Simplify file logging timestamping with timeval_str_buf()Martin Schwenke2014-10-281-9/+7
| | | | | | | If nothing else, this is slightly more portable. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Separate out syslog and file logging backendsMartin Schwenke2014-10-287-294/+387
| | | | | | | | | This makes the code cleaner and allows the syslog backend to be easily modified without affecting other code. Also do some extra clean-up, including whitespace fixups. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Rework debug level parsingMartin Schwenke2014-10-285-49/+59
| | | | | | | | | | | | | Put declarations into ctdb_logging.h, factor out some common code, clean up #includes. Remove the check so see if the 1st character of the debug level is '-'. This is wrong, since it is trying to check for a negative numeric debug level (which is no longer supported) and would need to be handled in the else anyway. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove ctdb element from struct ctdb_log_stateMartin Schwenke2014-10-282-7/+3
| | | | | | | | This is set but otherwise not used. This allows the 1st argument to ctdb_set_logfile() to be generalised to a TALLOC_CTX. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove log member from struct ctdb_contextMartin Schwenke2014-10-282-13/+11
| | | | | | | | | This is only used by logging code and there is already a file-level variable for this. struct ctdb_context already contains too many things. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Rename ctdb_log_handler() to ctdb_child_log_handler()Martin Schwenke2014-10-281-4/+5
| | | | | | | Now it is obvious that it has something to do with child processes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRITMartin Schwenke2014-10-286-15/+7
| | | | | | | | | | | | | | Internally map them to DEBUG_ERR to limit code churn. This reduces the unwieldy number of debug levels used by CTDB. ALERT and CRIT aren't of much use as separate errors, since everything from ERR up should always be logged. In future just ERR can be used. This also improves compatibility with Samba's debug.c system priority mapping. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Remove DEBUG_EMERGMartin Schwenke2014-10-286-36/+16
| | | | | | | | | | It isn't used and shouldn't be. CTDB can't make the system unusable. Update associated test to ensure that EMERG isn't attempted. Actually test all remaining debug levels and modernise the test a bit. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-test: Remove unused function check_ctdb_logfile()Martin Schwenke2014-10-281-13/+0
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-logging: Add missing newline when logging to fileMartin Schwenke2014-10-281-1/+1
| | | | | | | This got lost with the transition to the new Samba debug code. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tools: Fix heap-use-after-free problemAmitay Isaacs2014-10-171-2/+6
| | | | | | | | | | Found by address sanitizer. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Oct 17 12:56:02 CEST 2014 on sn-devel-104
* ctdb-build: Make some steps conditional on standalone buildMartin Schwenke2014-10-081-37/+49
| | | | | | | | | CTDB's current wscript assumes that it is only used as part of a standalone build. However, it will soon be part of a unified build so make some steps conditional. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb-build: Rename define BINDIR to CTDB_HELPER_BINDIRMartin Schwenke2014-10-083-3/+3
| | | | | | | | This avoids a clash with Samba's BINDIR and also makes it easier to move the helpers to somewhere else (e.g. libexec) in the future. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb-build: Fix handling of public headersMartin Schwenke2014-10-063-1/+12
| | | | | | | | | | | Add the header munging, add/package ctdb_version.h, create directory include/public. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Oct 6 14:56:07 CEST 2014 on sn-devel-104
* ctdb-build: Change from ctdb-util to samba-utilMartin Schwenke2014-10-0619-2295/+41
| | | | | | | | | | | | | | | | | | Remove local lib/util and lib/tdb-wrap. Update wscript, packaging and includes.h. The only potentially surprising thing here is a fake samba-util subsystem that just depends on samba-util-core. As explained in a comment: When a combined build is implemented, CTDB will wanted to build against samba-util rather than samba-util-core. Similarly, other Samba subsystems expect samba-util. So, for a standalone build, just define a fake samba-util subsystem that pulls in samba-util-core. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-build: Add generation of Samba-style version.hMartin Schwenke2014-10-061-0/+9
| | | | | | | This is needed by fault.c. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-build: Move generation of ctdb_version.h earlierMartin Schwenke2014-10-061-6/+6
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Update to use Samba style debug.h/debug.cMartin Schwenke2014-10-066-146/+92
| | | | | | | | | | | | | | | | | | | | | Samba's debug subsystem has changed a lot, so CTDB's logging needs to be rewritten to be compatible. The new debug.h/debug.c can't just be pulled in because it has some extra dependencies into Samba's lib/util. For now, to support the smallest possible patch, implement a minimal subset of Samba's debug.[ch] that just supports the DEBUG_CALLBACK logtype. Define a callback for each logging method. Check later to see if debug_extra (or similar) can somehow be implemented using debug classes. The timestamp on CTDB CLI tool and test program DEBUG() output goes away, so update the unit test code to cope. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Change LogLevel to DEBUGLEVELMartin Schwenke2014-10-0611-24/+24
| | | | | | | For compatibility with current Samba debug.[ch]. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-tests: Make the fake log timestamp string easy to modifyMartin Schwenke2014-10-0618-379/+380
| | | | | | | | | Use a variable to allow easy change of this string in case future logging changes modify the timestamp format or do not support timestamping. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* ctdb-logging: Remove log ringbufferMartin Schwenke2014-10-0616-468/+8
| | | | | | | | | | | As far as we know, nobody uses this and it just complicates the logging subsystem. Remove all ringbuffer code and documentation. Update the local daemons startup code correspondingly. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib: util [ctdb]: Signal handling - change CatchChild() and ↵Jeremy Allison2014-09-302-6/+6
| | | | | | | | | | | CatchChildLeaveStatus() to return the previous handler. Bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc. https://bugzilla.samba.org/show_bug.cgi?id=10831 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* lib/util: Do not duplicate the protocol list, use smb_constants.hAndrew Bartlett2014-09-291-11/+1
| | | | | | | | | This avoids the two lists getting out of sync, and only applies to a Samba build due to the surrounding #ifdef Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb-daemon: Fix the usage for lock helperAmitay Isaacs2014-09-251-2/+2
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Sep 25 17:16:31 CEST 2014 on sn-devel-104
* ctdb-recoverd: If obtaining recovery lock fails, try againAmitay Isaacs2014-09-251-0/+18
| | | | | | | | | | | When ctdb daemon starts up, it considers itself the recovery master and tries to do first recovery. However, it's possible that there is already a recovery master and the current node has not yet heard from it. So do not ban ourselves immediately if ctdb_recovery_lock() fails when doing first recovery. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-scripts: Fix the regular expresssion for parsing /proc/locksAmitay Isaacs2014-09-251-1/+1
| | | | | | | | | | The major and minor device numbers are hexadecimal not decimal. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Sep 25 07:19:59 CEST 2014 on sn-devel-104
* ctdb-locking: Reset ttimer before doing an early returnAmitay Isaacs2014-09-251-0/+1
| | | | | | | | | | | When timer expires, timeout handler routine sets lock_ctx->ttimer to a newly created timer event. However, when a node is INACTIVE, timeout handler returns early with lock_ctx->ttimer set to the previous timer event. This timer event gets freed when the callback returns and lock_ctx->ttimer remains set to already freed timer event. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-logging: Add forward declaration of debug_levelMartin Schwenke2014-09-231-0/+1
| | | | | | | | | | | | | | | Warnings are currently produced when compiling Samba and ctdb_private.h is included. A forward enum declaration avoids the warning. This is a temporary measure. The log ringbuffer should be removed soon. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Sep 23 10:31:50 CEST 2014 on sn-devel-104
* ctdb-tests: Clean up some tests where IP movement is checkedMartin Schwenke2014-09-239-411/+85
| | | | | | | | Some of this implements logic that exists in functions. Some of it is overly complicated and potentially failure-prone. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Remove dependency on log ringbuffer from missing IP testMartin Schwenke2014-09-232-29/+31
| | | | | | | | | | | | The log ringbuffer will probably be removed. The test can be implemented just as reliably by checking IP assignments using "ctdb ip". Update wait_until_ips_are_on_node() to print a more useful log message. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Make all_ips_on_node() do what it shouldMartin Schwenke2014-09-231-5/+7
| | | | | | | | | | | The "-n all" is wrong. Simplify the implementation and tighten up some uses of this function. _select_test_node_and_ips() can't use this function anymore. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Factor out new function get_test_ip_mask_and_iface()Martin Schwenke2014-09-232-13/+20
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Simplify and rename wait_until_ips_are_on_nodeglob()Martin Schwenke2014-09-238-20/+22
| | | | | | | | | The glob functionality is unsed so simplify the code by removing it. Rename this function to wait_until_ips_are_on_node(). Update all calls. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: Add missing configure checks for backtraceAmitay Isaacs2014-09-192-1/+5
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Sep 19 06:06:31 CEST 2014 on sn-devel-104
* ctdb-scripts: Do not export variables if they are not setAmitay Isaacs2014-09-171-2/+4
| | | | | | | | | | | Variables that are not set but exported, may return an empty string for getenv(). Tested on freebsd. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Sep 17 09:55:47 CEST 2014 on sn-devel-104
* ctdb-scripts: Fix a typoAmitay Isaacs2014-09-171-1/+1
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Check for libpcapAmitay Isaacs2014-09-171-1/+11
| | | | | | | | AIX and FreeBSD do not support raw sockets. So use libpcap interface to watch for specific TCP messages. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Check for ETIME in errno.hAmitay Isaacs2014-09-171-0/+3
| | | | | | | ETIME is not defined on freebsd. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-build: Add some missing configure checksMartin Schwenke2014-09-171-0/+10
| | | | | | | | Fail configure if thread_setsched() is unavailable on AIX or if sched_setscheduler() is unavailable on other platforms. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-build: Improve platform checkAmitay Isaacs2014-09-171-3/+3
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
* ctdb-util: Log an error if there is no way to set schedulerMartin Schwenke2014-09-171-0/+1
| | | | | | | | Although configure should catch this, logging a run-time error is better than being mystified when ctdbd silently exits. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* lib: Remove unused file_lines_slashcontVolker Lendecke2014-09-171-6/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Move "large_file_support()" to the source4 smb serverVolker Lendecke2014-09-171-1/+0
| | | | | | | That's the only place where it's used, make it static there. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>