[SCM] Samba Shared Repository - branch master updated
Amitay Isaacs
amitay at samba.org
Tue Oct 28 01:06:02 MDT 2014
The branch, master has been updated
via bf07a6b autobuild: check whether ctdbd has been installed in the samba-ctdb target
via a72ca5a build: adapt comments for the clustering choice
via bf98630 build: further simplify --with-cluster-support case in configure
via eeebbe7 autobuild: adapt samba-ctdb target does not need a separate ctdb build any more
via a54db68 ctdb: Rename CTDB_VERSION to CTDB_PROTOCOL
via 69c0c43 build: Simplify check for building with ctdb
via e67c4b9 build: Remove configure checks for ctdb headers
via 0d5ecaa ctdb: Rename ctdb socket variable from CTDB_PATH to CTDB_SOCKET
via 9933028 build: Remove configure option --with-ctdb-dir
via 18100b8 build: Remove checks for ctdb features
via 5e7ab5c build: Remove configure option --enable-old-ctdb
via 1a8d431 ctdb-logging: Add logging via UDP logging using RFC5424
via 8ed3ff4 ctdb-logging: Add logging via UDP to 127.0.0.1:514 to syslog backend
via a6e770e ctdb-logging: Add non-blocking Unix domain logging to syslog backend
via 1d1cd04 ctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOG
via 2974554 ctdb-logging: Replace logd code with a basic syslog(3) implementation
via 38c8e15 ctdb-logging: Simplify file logging timestamping with timeval_str_buf()
via 739324e ctdb-logging: Separate out syslog and file logging backends
via a22c8ca ctdb-logging: Rework debug level parsing
via d9d572a ctdb-logging: Remove ctdb element from struct ctdb_log_state
via dfd502c ctdb-logging: Remove log member from struct ctdb_context
via 7d391b7 ctdb-logging: Rename ctdb_log_handler() to ctdb_child_log_handler()
via f4fc9a1 ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRIT
via 0eabbb8 ctdb-logging: Remove DEBUG_EMERG
via 85cc4ef ctdb-test: Remove unused function check_ctdb_logfile()
via 96106e0 ctdb-logging: Add missing newline when logging to file
from d4f233a spoolss: fix handling of bad EnumJobs levels
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit bf07a6b79e525a2aba71e07c4e13f2b2cb06b12f
Author: Michael Adam <obnox at samba.org>
Date: Sat Oct 25 18:01:30 2014 +0200
autobuild: check whether ctdbd has been installed in the samba-ctdb target
An intermediate test until we have full runtime-tests.
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Tue Oct 28 08:05:40 CET 2014 on sn-devel-104
commit a72ca5a200c6321f3e3a42761dc3d661dacd5021
Author: Michael Adam <obnox at samba.org>
Date: Fri Oct 24 17:55:17 2014 +0200
build: adapt comments for the clustering choice
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit bf98630f0a44597e61cdfc735ab73d862643007b
Author: Michael Adam <obnox at samba.org>
Date: Fri Oct 24 17:53:08 2014 +0200
build: further simplify --with-cluster-support case in configure
includes were only built for the ctdb checks and they are now
gone because we are building against included ctdb.
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit eeebbe73125967943d95b6e03cbf695d3d219bc0
Author: Michael Adam <obnox at samba.org>
Date: Fri Oct 24 17:42:51 2014 +0200
autobuild: adapt samba-ctdb target does not need a separate ctdb build any more
Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit a54db687acc14351613738d93a4e99ceaa2c6759
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Oct 21 11:53:29 2014 +1100
ctdb: Rename CTDB_VERSION to CTDB_PROTOCOL
CTDB_VERSION really is the ctdb protocol version.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 69c0c43d55c93b82b2e398d5c61009fd347170bf
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Oct 10 14:29:51 2014 +1100
build: Simplify check for building with ctdb
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e67c4b977a52d1744f4da8296bbcd7c213cbe92a
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Oct 10 14:25:34 2014 +1100
build: Remove configure checks for ctdb headers
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 0d5ecaa2e38b55e981cb2770a945d14ab1d98589
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Oct 10 12:02:26 2014 +1100
ctdb: Rename ctdb socket variable from CTDB_PATH to CTDB_SOCKET
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 9933028a657f01d7ff9db5fca19887f5e0523299
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Oct 10 11:42:05 2014 +1100
build: Remove configure option --with-ctdb-dir
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 18100b80b9c62833df22638828336294c9740ae0
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Oct 10 10:54:15 2014 +1100
build: Remove checks for ctdb features
Since we are always building with integrated CTDB, there is no need for
these checks.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 5e7ab5ce38689a2dd1e921abf58af346b730a843
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Oct 10 10:59:06 2014 +1100
build: Remove configure option --enable-old-ctdb
CTDB source is now part of Samba tree and to enable clustering smbd
should be built against included CTDB.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 1a8d43193614700bd5b4563207328cbfffecf230
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 8 20:59:21 2014 +1000
ctdb-logging: Add logging via UDP logging using RFC5424
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 8ed3ff456ca7a239cba399e6b6d12c468a608db2
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 8 20:59:21 2014 +1000
ctdb-logging: Add logging via UDP to 127.0.0.1:514 to syslog backend
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit a6e770ec287b78ec2d2c85a6d0c22a67bd03a4d6
Author: Martin Schwenke <martin at meltin.net>
Date: Sat Oct 18 14:39:30 2014 +1100
ctdb-logging: Add non-blocking Unix domain logging to syslog backend
Format messages as per RFC3164.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 1d1cd04cb9b8e66e0303c362669db2c6c47fccae
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 11 17:07:41 2014 +1000
ctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOG
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 29745543566ef66c1f2972fd5cd68e17ddf4de4f
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 8 20:57:05 2014 +1000
ctdb-logging: Replace logd code with a basic syslog(3) implementation
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 38c8e15690331c4798f9caf3be6a44251d3db809
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 16 19:46:43 2014 +1100
ctdb-logging: Simplify file logging timestamping with timeval_str_buf()
If nothing else, this is slightly more portable.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 739324eead1d8ece13151504c0a54ab5c82e51db
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 8 20:54:54 2014 +1000
ctdb-logging: Separate out syslog and file logging backends
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit a22c8ca05618a63d6923fcf7dc567d1cd6119009
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 8 13:36:00 2014 +1000
ctdb-logging: Rework debug level parsing
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit d9d572a23cf527780caae9d7ff143376e9057f6a
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 16 20:03:51 2014 +1100
ctdb-logging: Remove ctdb element from struct ctdb_log_state
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit dfd502c80c1dc59ad678f9f5ec7f6fe6f37a8c14
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 8 11:50:37 2014 +1000
ctdb-logging: Remove log member from struct ctdb_context
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 7d391b746695d7a262e4f939f057ee1d1685e12b
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 8 11:42:51 2014 +1000
ctdb-logging: Rename ctdb_log_handler() to ctdb_child_log_handler()
Now it is obvious that it has something to do with child processes.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit f4fc9a153c533968905b8c7945c6615dcd9253d1
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Oct 8 14:22:53 2014 +1100
ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRIT
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 0eabbb8c2b91b61a23f20e04605fdbd653c5cbcb
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Oct 8 14:19:22 2014 +1100
ctdb-logging: Remove DEBUG_EMERG
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 at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 85cc4efbff601dc25a351ec838de168eb3c7d29a
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 12 14:29:34 2014 +1000
ctdb-test: Remove unused function check_ctdb_logfile()
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 96106e085a3a8bab51c8b14e85ba1a817d5fa55b
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Oct 15 20:04:45 2014 +1100
ctdb-logging: Add missing newline when logging to file
This got lost with the transition to the new Samba debug code.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
-----------------------------------------------------------------------
Summary of changes:
ctdb/client/ctdb_client.c | 6 +-
ctdb/common/cmdline.c | 12 +-
ctdb/common/ctdb_logging.c | 48 +++-
ctdb/config/ctdb.sysconfig | 3 +-
ctdb/config/ctdbd_wrapper | 17 +-
ctdb/config/functions | 28 ++-
ctdb/doc/ctdb.1.xml | 4 +-
ctdb/doc/ctdb.7.xml | 3 -
ctdb/doc/ctdbd.1.xml | 87 ++++++-
ctdb/doc/ctdbd.conf.5.xml | 88 ++++++-
ctdb/doc/examples/cluster.conf | 2 +-
ctdb/doc/examples/natgw.conf | 2 +-
ctdb/include/ctdb_client.h | 11 -
ctdb/include/ctdb_logging.h | 24 ++-
ctdb/include/ctdb_private.h | 15 +-
ctdb/include/ctdb_protocol.h | 6 +-
ctdb/server/ctdb_daemon.c | 14 +-
ctdb/server/ctdb_logging.c | 357 ++++----------------------
ctdb/server/ctdb_logging_file.c | 113 ++++++++
ctdb/server/ctdb_logging_syslog.c | 318 +++++++++++++++++++++++
ctdb/server/ctdbd.c | 15 +-
ctdb/tcp/tcp_io.c | 2 +-
ctdb/tests/eventscripts/scripts/local.sh | 18 +-
ctdb/tests/simple/13_ctdb_setdebug.sh | 42 +--
ctdb/tests/simple/scripts/local_daemons.bash | 2 +-
ctdb/tests/src/ctdbd_test.c | 2 +
ctdb/tools/ctdb.c | 38 +--
ctdb/utils/pmda/pmda_ctdb.c | 2 +-
ctdb/wscript | 5 +-
script/autobuild.py | 8 +-
source3/lib/cluster_support.c | 46 +---
source3/lib/ctdb_conn.c | 8 +-
source3/lib/ctdbd_conn.c | 30 +--
source3/lib/dbwrap/dbwrap_ctdb.c | 11 -
source3/torture/test_ctdbconn.c | 4 -
source3/wscript | 309 +----------------------
wscript | 3 +-
37 files changed, 814 insertions(+), 889 deletions(-)
create mode 100644 ctdb/server/ctdb_logging_file.c
create mode 100644 ctdb/server/ctdb_logging_syslog.c
Changeset truncated at 500 lines:
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index 7d629db..07b17d0 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -54,7 +54,7 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb,
hdr->length = length;
hdr->operation = operation;
hdr->ctdb_magic = CTDB_MAGIC;
- hdr->ctdb_version = CTDB_VERSION;
+ hdr->ctdb_version = CTDB_PROTOCOL;
hdr->srcnode = ctdb->pnn;
if (ctdb->vnn_map) {
hdr->generation = ctdb->vnn_map->generation;
@@ -216,7 +216,7 @@ void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args)
goto done;
}
- if (hdr->ctdb_version != CTDB_VERSION) {
+ if (hdr->ctdb_version != CTDB_PROTOCOL) {
ctdb_set_error(ctdb, "Bad CTDB version 0x%x rejected in client\n", hdr->ctdb_version);
goto done;
}
@@ -3375,7 +3375,7 @@ struct ctdb_context *ctdb_init(struct event_context *ev)
ctdb->lastid = INT_MAX-200;
CTDB_NO_MEMORY_NULL(ctdb, ctdb->idr);
- ret = ctdb_set_socketname(ctdb, CTDB_PATH);
+ ret = ctdb_set_socketname(ctdb, CTDB_SOCKET);
if (ret != 0) {
DEBUG(DEBUG_ERR,(__location__ " ctdb_set_socketname failed.\n"));
talloc_free(ctdb);
diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c
index ab2b45e..4ed3fae 100644
--- a/ctdb/common/cmdline.c
+++ b/ctdb/common/cmdline.c
@@ -96,10 +96,8 @@ struct ctdb_context *ctdb_cmdline_init(struct event_context *ev)
}
/* Set the debug level */
- if (isalpha(ctdb_cmdline.debuglevel[0]) || ctdb_cmdline.debuglevel[0] == '-') {
- DEBUGLEVEL = get_debug_by_desc(ctdb_cmdline.debuglevel);
- } else {
- DEBUGLEVEL = strtol(ctdb_cmdline.debuglevel, NULL, 0);
+ if (!parse_debug(ctdb_cmdline.debuglevel, &DEBUGLEVEL)) {
+ DEBUGLEVEL = DEBUG_ERR;
}
/* set up the tree to store server ids */
@@ -147,10 +145,8 @@ struct ctdb_context *ctdb_cmdline_client(struct tevent_context *ev,
}
/* Set the debug level */
- if (isalpha(ctdb_cmdline.debuglevel[0]) || ctdb_cmdline.debuglevel[0] == '-') {
- DEBUGLEVEL = get_debug_by_desc(ctdb_cmdline.debuglevel);
- } else {
- DEBUGLEVEL = strtol(ctdb_cmdline.debuglevel, NULL, 0);
+ if (!parse_debug(ctdb_cmdline.debuglevel, &DEBUGLEVEL)) {
+ DEBUGLEVEL = DEBUG_ERR;
}
ret = ctdb_socket_connect(ctdb);
diff --git a/ctdb/common/ctdb_logging.c b/ctdb/common/ctdb_logging.c
index 9b5103a..e76966c 100644
--- a/ctdb/common/ctdb_logging.c
+++ b/ctdb/common/ctdb_logging.c
@@ -17,18 +17,18 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
-#include "tdb.h"
-#include "system/time.h"
-#include "../include/ctdb_private.h"
-#include "../include/ctdb_client.h"
+#include <ctype.h>
+#include "replace.h"
+#include "ctdb_logging.h"
const char *debug_extra = "";
-struct debug_levels debug_levels[] = {
- {DEBUG_EMERG, "EMERG"},
- {DEBUG_ALERT, "ALERT"},
- {DEBUG_CRIT, "CRIT"},
+struct debug_levels {
+ int32_t level;
+ const char *description;
+};
+
+static struct debug_levels debug_levels[] = {
{DEBUG_ERR, "ERR"},
{DEBUG_WARNING, "WARNING"},
{DEBUG_NOTICE, "NOTICE"},
@@ -46,18 +46,40 @@ const char *get_debug_by_level(int32_t level)
return debug_levels[i].description;
}
}
- return "Unknown";
+ return NULL;
}
-int32_t get_debug_by_desc(const char *desc)
+static bool get_debug_by_desc(const char *desc, int32_t *level)
{
int i;
for (i=0; debug_levels[i].description != NULL; i++) {
if (!strcasecmp(debug_levels[i].description, desc)) {
- return debug_levels[i].level;
+ *level = debug_levels[i].level;
+ return true;
}
}
- return DEBUG_ERR;
+ return false;
+}
+
+bool parse_debug(const char *str, int32_t *level)
+{
+ if (isalpha(str[0])) {
+ return get_debug_by_desc(str, level);
+ } else {
+ *level = strtol(str, NULL, 0);
+ return get_debug_by_level(*level) != NULL;
+ }
+}
+
+void print_debug_levels(FILE *stream)
+{
+ int i;
+
+ for (i=0; debug_levels[i].description != NULL; i++) {
+ fprintf(stream,
+ "%s (%d)\n",
+ debug_levels[i].description, debug_levels[i].level);
+ }
}
diff --git a/ctdb/config/ctdb.sysconfig b/ctdb/config/ctdb.sysconfig
index db34c07..b44e478 100644
--- a/ctdb/config/ctdb.sysconfig
+++ b/ctdb/config/ctdb.sysconfig
@@ -23,8 +23,7 @@ CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
# ulimit -n 10000
# Default is to use the log file below instead of syslog.
-# CTDB_LOGFILE=/var/log/log.ctdb
-# CTDB_SYSLOG=no
+# CTDB_LOGGING=file:/var/log/log.ctdb
# Default log level is ERR. NOTICE is a little more verbose.
CTDB_DEBUGLEVEL=NOTICE
diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index c2c5c1a..9159b27 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -111,7 +111,7 @@ build_ctdb_options ()
maybe_set "--pidfile" "$pidfile"
# build up ctdb_options variable from optional parameters
- maybe_set "--logfile" "$CTDB_LOGFILE"
+ maybe_set "--logging" "$CTDB_LOGGING"
maybe_set "--nlist" "$CTDB_NODES"
maybe_set "--socket" "$CTDB_SOCKET"
maybe_set "--public-addresses" "$CTDB_PUBLIC_ADDRESSES"
@@ -129,7 +129,6 @@ build_ctdb_options ()
maybe_set "--no-lmaster" "$CTDB_CAPABILITY_LMASTER" "no"
maybe_set "--lvs --single-public-ip" "$CTDB_LVS_PUBLIC_IP"
maybe_set "--script-log-level" "$CTDB_SCRIPT_LOG_LEVEL"
- maybe_set "--syslog" "$CTDB_SYSLOG" "yes"
maybe_set "--max-persistent-check-errors" "$CTDB_MAX_PERSISTENT_CHECK_ERRORS"
}
@@ -187,9 +186,17 @@ start()
ctdb_options="${ctdb_options} --valgrinding"
fi
- if [ "$CTDB_SYSLOG" != "yes" ] ; then
- logger -t ctdbd "CTDB is being run without syslog enabled. Logs will be in ${CTDB_LOGFILE:-/var/log/log.ctdb}"
- fi
+ case "$CTDB_LOGGING" in
+ syslog:udp|syslog:udp-rfc5424)
+ logger -t ctdbd "CTDB is being run with ${CTDB_LOGGING}. If nothing is logged then check your syslogd configuration"
+ ;;
+ syslog|syslog:*) : ;;
+ file:*)
+ logger -t ctdbd "CTDB is being run without syslog enabled. Logs will be in ${CTDB_LOGGING#file:}"
+ ;;
+ *)
+ logger -t ctdbd "CTDB is being run without syslog enabled. Logs will be in log.ctdb"
+ esac
eval "$ctdbd" "$ctdb_options" || return 1
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 3f2ccee..53a36dc 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -86,17 +86,27 @@ script_log ()
{
_tag="$1" ; shift
- if [ "$CTDB_SYSLOG" = "yes" ] ; then
- logger -t "ctdbd: ${_tag}" $*
- else
- {
- if [ -n "$*" ] ; then
- echo "$*"
+ case "$CTDB_LOGGING" in
+ file:*|"")
+ if [ -n "$CTDB_LOGGING" ] ; then
+ _file="${CTDB_LOGGING#file:}"
else
- cat
+ _file="/var/log/log.ctdb"
fi
- } >>"${CTDB_LOGFILE:-/var/log/log.ctdb}"
- fi
+ {
+ if [ -n "$*" ] ; then
+ echo "$*"
+ else
+ cat
+ fi
+ } >>"$_file"
+ ;;
+ *)
+ # Handle all syslog:* variants here too. There's no tool to do
+ # the lossy things, so just use logger.
+ logger -t "ctdbd: ${_tag}" $*
+ ;;
+ esac
}
# When things are run in the background in an eventscript then logging
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index efa5d85..170d05a 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -902,7 +902,7 @@ DB Statistics: locking.tdb
The list of debug levels from highest to lowest are :
</para>
<para>
- EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
@@ -912,7 +912,7 @@ DB Statistics: locking.tdb
Set the debug level of a node. This controls what information will be logged.
</para>
<para>
- The debuglevel is one of EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ The debuglevel is one of ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml
index a94b62f..b54fa42 100644
--- a/ctdb/doc/ctdb.7.xml
+++ b/ctdb/doc/ctdb.7.xml
@@ -883,9 +883,6 @@ CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1
</para>
<simplelist>
- <member>EMERG (-3)</member>
- <member>ALERT (-2)</member>
- <member>CRIT (-1)</member>
<member>ERR (0)</member>
<member>WARNING (1)</member>
<member>NOTICE (2)</member>
diff --git a/ctdb/doc/ctdbd.1.xml b/ctdb/doc/ctdbd.1.xml
index 20f2d8b..a499318 100644
--- a/ctdb/doc/ctdbd.1.xml
+++ b/ctdb/doc/ctdbd.1.xml
@@ -51,9 +51,10 @@
<listitem>
<para>
This option sets the debug level to DEBUGLEVEL, which
- controls what will be written to the logfile. The default is
- 0 which will only log important events and errors. A larger
- number will provide additional logging.
+ controls what will be written by the logging
+ subsystem. The default is 0 which will only log important
+ events and errors. A larger number will provide additional
+ logging.
</para>
<para>
See the <citetitle>DEBUG LEVELS</citetitle> section in
@@ -127,12 +128,86 @@
</varlistentry>
<varlistentry>
- <term>--logfile=<parameter>FILENAME</parameter></term>
+ <term>--logging=<parameter>STRING</parameter></term>
<listitem>
<para>
- FILENAME where ctdbd will write its log. This is usually
- <filename>/var/log/log.ctdb</filename>.
- </para>
+ STRING specifies where ctdbd will write its log. The
+ default is file:<filename>/var/log/log.ctdb</filename> or
+ similar - the prefix may differ depending on how CTDB was
+ built.
+ </para>
+ <para>
+ Valid values are:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>file:<parameter>FILENAME</parameter></term>
+ <listitem>
+ <para>
+ FILENAME where ctdbd will write its log. This is usually
+ <filename>/var/log/log.ctdb</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>syslog<optional>:<parameter>METHOD</parameter></optional></term>
+ <listitem>
+ <para>
+ CTDB will log to syslog. By default this will use
+ the syslog(3) API.
+ </para>
+ <para>
+ Under heavy loads syslog(3) can block if the syslog
+ daemon processes messages too slowly. This can
+ cause CTDB to block when logging.
+ </para>
+ <para>
+ If METHOD is specified then it specifies an
+ extension that causes logging to be done in a
+ non-blocking mode. Note that <emphasis>this may
+ cause messages to be dropped</emphasis>. METHOD
+ must be one of:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>nonblocking</term>
+ <listitem>
+ <para>
+ CTDB will log to syslog via
+ <filename>/dev/log</filename> in non-blocking
+ mode.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>udp</term>
+ <listitem>
+ <para>
+ CTDB will log to syslog via UDP to
+ localhost:514. The syslog daemon must be
+ configured to listen on (at least)
+ localhost:514. Most syslog daemons will log
+ the messages with hostname "localhost" - this
+ is a limitation of the implementation, for
+ compatibility with more syslog daemons.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>udp-rfc5424</term>
+ <listitem>
+ <para>
+ As with "udp" but messages are sent in RFC5424
+ format. This method will log the correct
+ hostname but is not as widely implemented in
+ syslog daemons.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</listitem>
</varlistentry>
diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml
index e316abb..cb48d72 100644
--- a/ctdb/doc/ctdbd.conf.5.xml
+++ b/ctdb/doc/ctdbd.conf.5.xml
@@ -220,13 +220,84 @@
</varlistentry>
<varlistentry>
- <term>CTDB_LOGFILE=<parameter>FILENAME</parameter></term>
+ <term>CTDB_LOGGING=<parameter>STRING</parameter></term>
<listitem>
<para>
- Defaults to <filename>/var/log/log.ctdb</filename>.
- Corresponds to <option>--logfile</option>. See also
- <citetitle>CTDB_SYSLOG</citetitle>.
+ STRING specifies where ctdbd will write its log. The
+ default is file:<filename>/var/log/log.ctdb</filename> or
+ similar - the prefix may differ depending on how CTDB was
+ built. Corresponds to <option>--logging</option>.
</para>
+ <para>
+ Valid values are:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>file:<parameter>FILENAME</parameter></term>
+ <listitem>
+ <para>
+ FILENAME where ctdbd will write its log. This is usually
+ <filename>/var/log/log.ctdb</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>syslog<optional>:<parameter>METHOD</parameter></optional></term>
+ <listitem>
+ <para>
+ CTDB will log to syslog. By default this will use
+ the syslog(3) API.
+ </para>
+ <para>
+ If METHOD is specified then it specifies an
+ extension that causes logging to be done in a
+ non-blocking fashion. This can be useful under
+ heavy loads that might cause the syslog daemon to
+ dequeue messages too slowly, which would otherwise
+ cause CTDB to block when logging. METHOD must be
+ one of:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>nonblocking</term>
+ <listitem>
+ <para>
+ CTDB will log to syslog via
+ <filename>/dev/log</filename> in non-blocking
+ mode.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>udp</term>
+ <listitem>
+ <para>
+ CTDB will log to syslog via UDP to
+ localhost:514. The syslog daemon must be
+ configured to listen on (at least)
+ localhost:514. Most implementations will log
+ the messages against hostname "localhost" -
+ this is a limit of the implementation for
+ compatibility with more syslog daemon
+ implementations.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>udp-rfc5424</term>
+ <listitem>
+ <para>
+ As with "udp" but messages are sent in RFC5424
+ format. This method will log the correct
+ hostname but is not as widely implemented in
+ syslog daemons.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</listitem>
</varlistentry>
@@ -354,15 +425,6 @@
</varlistentry>
<varlistentry>
- <term>CTDB_SYSLOG=yes|no</term>
- <listitem>
- <para>
- Default is no. Corresponds to <option>--syslog</option>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term>CTDB_TRANSPORT=tcp|infiniband</term>
<listitem>
<para>
diff --git a/ctdb/doc/examples/cluster.conf b/ctdb/doc/examples/cluster.conf
index 871468e..8da982c 100644
--- a/ctdb/doc/examples/cluster.conf
+++ b/ctdb/doc/examples/cluster.conf
@@ -68,7 +68,7 @@ CTDB_NODES=/etc/ctdb/nodes
CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
# Enable logging to syslog
-CTDB_SYSLOG=yes
+CTDB_LOGGING=syslog
--
Samba Shared Repository
More information about the samba-cvs
mailing list