This avoids hardcoding path components in source.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb->pnn = -1;
/* Default value for CTDB_BASE - don't override */
- setenv("CTDB_BASE", ETCDIR "/ctdb", 0);
+ setenv("CTDB_BASE", CTDB_ETCDIR, 0);
/* tell ctdb what nodes are available */
if (options.nlist != NULL) {
static void ctdb_run_debug_hung_script(struct ctdb_context *ctdb, struct debug_hung_script_state *state)
{
pid_t pid;
- const char * debug_hung_script = ETCDIR "/ctdb/debug-hung-script.sh";
+ const char * debug_hung_script = CTDB_ETCDIR "/debug-hung-script.sh";
int fd[2];
struct tevent_timer *ttimer;
struct tevent_fd *tfd;
control = extra_argv[0];
/* Default value for CTDB_BASE - don't override */
- setenv("CTDB_BASE", ETCDIR "/ctdb", 0);
+ setenv("CTDB_BASE", CTDB_ETCDIR, 0);
ev = event_context_init(NULL);
if (!ev) {
conf.env.CTDB_SOCKPATH = os.path.join(conf.env.CTDB_RUNDIR,
'ctdbd.socket')
- conf.ADD_CFLAGS('''-DBINDIR=\"%s\" -DETCDIR=\"%s\"
- -DLOGDIR=\"%s\" -DSOCKPATH=\"%s\"
+ conf.ADD_CFLAGS('''-DBINDIR=\"%s\"
+ -DLOGDIR=\"%s\"
+ -DSOCKPATH=\"%s\"
+ -DCTDB_ETCDIR=\"%s\"
-DCTDB_VARDIR=\"%s\"
-DCTDB_RUNDIR=\"%s\"''' % (
conf.env.CTDB_BINDIR,
- conf.env.CTDB_ETCDIR,
conf.env.CTDB_LOGDIR,
conf.env.CTDB_SOCKPATH,
+ conf.env.CTDB_ETCDIR,
conf.env.CTDB_VARDIR,
conf.env.CTDB_RUNDIR))