From: Martin Schwenke Date: Thu, 26 Apr 2018 01:58:13 +0000 (+1000) Subject: ctdb-daemon: Change default volatile database directory X-Git-Tag: ldb-1.4.0~472 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb7ec16a963e13e903171227b655dbbf7f2a4051;p=thirdparty%2Fsamba.git ctdb-daemon: Change default volatile database directory Volatile databases now have their own subdirectory. This makes things easier if we later recommend mounting a tmpfs on the volatile database directory, rather than supporting the current CTDB_DBDIR=tmpfs magic. No need to create database directories for local daemon tests. ctdbd will do that. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/debug_locks.sh b/ctdb/config/debug_locks.sh index 3feb121e2ba..e51640bbee5 100755 --- a/ctdb/config/debug_locks.sh +++ b/ctdb/config/debug_locks.sh @@ -14,7 +14,7 @@ # Default fallback location for database directories. # These can be overwritten from CTDB configuration -CTDB_DBDIR="${CTDB_VARDIR}" +CTDB_DBDIR="${CTDB_VARDIR}/volatile" CTDB_DBDIR_PERSISTENT="${CTDB_VARDIR}/persistent" loadconfig diff --git a/ctdb/doc/ctdbd.1.xml b/ctdb/doc/ctdbd.1.xml index 47c4007a5fb..abab2a4121f 100644 --- a/ctdb/doc/ctdbd.1.xml +++ b/ctdb/doc/ctdbd.1.xml @@ -72,7 +72,7 @@ should not be stored on the shared cluster filesystem. - Defaults to /usr/local/var/lib/ctdb. + Defaults to /usr/local/var/lib/ctdb/volatile. diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml index d0b25c1eab2..3452f84047e 100644 --- a/ctdb/doc/ctdbd.conf.5.xml +++ b/ctdb/doc/ctdbd.conf.5.xml @@ -140,7 +140,7 @@ CTDB_DBDIR=DIRECTORY - Defaults to /usr/local/var/lib/ctdb. + Defaults to /usr/local/var/lib/ctdb/volatile. Apart from a DIRECTORY, this can take a special value of diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index b9c502c22b4..b93686acd8e 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -60,7 +60,7 @@ static struct { .debuglevel = "NOTICE", .transport = "tcp", .logging = "file:" LOGDIR "/log.ctdb", - .db_dir = CTDB_VARDIR, + .db_dir = CTDB_VARDIR "/volatile", .db_dir_persistent = CTDB_VARDIR "/persistent", .db_dir_state = CTDB_VARDIR "/state", .script_log_level = DEBUG_ERR, diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index a90adeca479..49c84baa95e 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -86,7 +86,7 @@ setup_script_options () setup_dbdir () { export CTDB_DBDIR_BASE="${EVENTSCRIPTS_TESTS_VAR_DIR}/db" - export CTDB_DBDIR="$CTDB_DBDIR_BASE" + export CTDB_DBDIR="${CTDB_DBDIR_BASE}/volatile" export CTDB_DBDIR_PERSISTENT="${CTDB_DBDIR_BASE}/persistent" export CTDB_DBDIR_STATE="${CTDB_DBDIR_BASE}/state" mkdir -p "$CTDB_DBDIR" diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash index a17fef2b998..e68ca226454 100644 --- a/ctdb/tests/simple/scripts/local_daemons.bash +++ b/ctdb/tests/simple/scripts/local_daemons.bash @@ -131,7 +131,6 @@ setup_ctdb () local node_ip=$(sed -n -e "$(($pnn + 1))p" "$nodes_file") local db_dir="${CTDB_BASE}/db" - mkdir -p "${db_dir}/persistent" if $no_event_scripts ; then rm -vf "${CTDB_BASE}/events.d/"* @@ -142,7 +141,7 @@ CTDB_RECOVERY_LOCK="${SIMPLE_TESTS_VAR_DIR}/rec.lock" CTDB_NODE_ADDRESS="${node_ip}" CTDB_LOGGING="file:${CTDB_BASE}/log.ctdb" CTDB_DEBUGLEVEL=INFO -CTDB_DBDIR="${db_dir}" +CTDB_DBDIR="${db_dir}/volatile" CTDB_DBDIR_PERSISTENT="${db_dir}/persistent" CTDB_DBDIR_STATE="${db_dir}/state" EOF