#include "common/system_socket.h"
#include "common/common.h"
#include "common/logging.h"
+#include "common/path.h"
#include "conf/ctdb_config.h"
/* If no public addresses file given then try the default */
if (ctdb->public_addresses_file == NULL) {
- const char *b = getenv("CTDB_BASE");
- if (b == NULL) {
- DBG_ERR("CTDB_BASE not set\n");
- return -1;
- }
- ctdb->public_addresses_file = talloc_asprintf(
- ctdb, "%s/%s", b, "public_addresses");
+ ctdb->public_addresses_file = path_etcdir_append(
+ ctdb, "public_addresses");
if (ctdb->public_addresses_file == NULL) {
DBG_ERR("Out of memory\n");
return -1;
ctdb_tunables_load(ctdb);
- ctdb->event_script_dir = talloc_asprintf(ctdb,
- "%s/events/legacy",
- ctdb_base);
+ ctdb->event_script_dir = path_etcdir_append(ctdb, "events/legacy");
if (ctdb->event_script_dir == NULL) {
DBG_ERR("Out of memory\n");
goto fail;
}
- ctdb->notification_script = talloc_asprintf(ctdb,
- "%s/notify.sh",
- ctdb_base);
+ ctdb->notification_script = path_etcdir_append(ctdb, "notify.sh");
if (ctdb->notification_script == NULL) {
D_ERR("Unable to set notification script\n");
goto fail;