From 9a5ba6b9c939214f5f133a184817bd68f6b86279 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 16 Apr 2018 19:05:54 +1000 Subject: [PATCH] ctdb-daemon: Log the logging location when not logging via syslog() A variant of this is currently done by the wrapper but will be removed from there because the wrapper will no longer see the CTDB_LOGGING option. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/server/ctdbd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index 93a0e8d6dfe..b9c502c22b4 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -22,6 +22,7 @@ #include "system/time.h" #include "system/wait.h" #include "system/network.h" +#include "system/syslog.h" #include #include @@ -261,6 +262,13 @@ int main(int argc, const char *argv[]) options.logging = "file:"; } + if (strcmp(options.logging, "syslog") != 0) { + /* This can help when CTDB logging is misconfigured */ + syslog(LOG_DAEMON|LOG_NOTICE, + "CTDB logging to location %s", + options.logging); + } + /* Initialize logging and set the debug level */ if (!ctdb_logging_init(ctdb, options.logging, options.debuglevel)) { goto fail; -- 2.47.2