summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_ltdb_server.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-10-21 19:36:36 +1100
committerAmitay Isaacs <amitay@gmail.com>2013-10-25 12:06:06 +1100
commita604c3d945303d58ce12f20de6a3a6fad1493f49 (patch)
treebc303d295dadc2e02637265d7c7f78b8f91718d1 /ctdb/server/ctdb_ltdb_server.c
parentbd73e017b0d4943a35da95eef7f1a88a96f21648 (diff)
downloadsamba-a604c3d945303d58ce12f20de6a3a6fad1493f49.tar.gz
samba-a604c3d945303d58ce12f20de6a3a6fad1493f49.tar.xz
samba-a604c3d945303d58ce12f20de6a3a6fad1493f49.zip
ctdbd: Remove duplicate database directory setting logic
Defaults for ctdb->db_directory and similar variables are currently set in 2 places. Change this to set them in only 1 place and make the directories at initialisation time instead of waiting until later. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d73d84346488a2ed54e6a86f9d7ec641c8e33ace)
Diffstat (limited to 'ctdb/server/ctdb_ltdb_server.c')
-rw-r--r--ctdb/server/ctdb_ltdb_server.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index db9bc01295a..234ecac5fcd 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -1235,40 +1235,6 @@ int ctdb_attach_databases(struct ctdb_context *ctdb)
char *unhealthy_reason = NULL;
bool first_try = true;
- if (ctdb->db_directory == NULL) {
- ctdb->db_directory = VARDIR "/ctdb";
- }
- if (ctdb->db_directory_persistent == NULL) {
- ctdb->db_directory_persistent = VARDIR "/ctdb/persistent";
- }
- if (ctdb->db_directory_state == NULL) {
- ctdb->db_directory_state = VARDIR "/ctdb/state";
- }
-
- /* make sure the db directory exists */
- ret = mkdir(ctdb->db_directory, 0700);
- if (ret == -1 && errno != EEXIST) {
- DEBUG(DEBUG_CRIT,(__location__ " Unable to create ctdb directory '%s'\n",
- ctdb->db_directory));
- return -1;
- }
-
- /* make sure the persistent db directory exists */
- ret = mkdir(ctdb->db_directory_persistent, 0700);
- if (ret == -1 && errno != EEXIST) {
- DEBUG(DEBUG_CRIT,(__location__ " Unable to create ctdb persistent directory '%s'\n",
- ctdb->db_directory_persistent));
- return -1;
- }
-
- /* make sure the internal state db directory exists */
- ret = mkdir(ctdb->db_directory_state, 0700);
- if (ret == -1 && errno != EEXIST) {
- DEBUG(DEBUG_CRIT,(__location__ " Unable to create ctdb state directory '%s'\n",
- ctdb->db_directory_state));
- return -1;
- }
-
persistent_health_path = talloc_asprintf(ctdb, "%s/%s.%u",
ctdb->db_directory_state,
PERSISTENT_HEALTH_TDB,