mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
fix: create data directory after sanity check
This commit is contained in:
17
repmgr.c
17
repmgr.c
@@ -1500,14 +1500,6 @@ do_witness_create(void)
|
||||
|
||||
char master_hba_file[MAXLEN];
|
||||
|
||||
/* Check this directory could be used as a PGDATA dir */
|
||||
if (!create_pgdir(runtime_options.dest_dir, runtime_options.force))
|
||||
{
|
||||
log_err(_("witness create: couldn't create data directory (\"%s\") for witness"),
|
||||
runtime_options.dest_dir);
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
/* Connection parameters for master only */
|
||||
keywords[0] = "host";
|
||||
values[0] = runtime_options.host;
|
||||
@@ -1549,6 +1541,15 @@ do_witness_create(void)
|
||||
exit(ERR_BAD_SSH);
|
||||
}
|
||||
|
||||
/* Check this directory could be used as a PGDATA dir */
|
||||
if (!create_pgdir(runtime_options.dest_dir, runtime_options.force))
|
||||
{
|
||||
log_err(_("witness create: couldn't create data directory (\"%s\") for witness"),
|
||||
runtime_options.dest_dir);
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* To create a witness server we need to:
|
||||
* 1) initialize the cluster
|
||||
|
||||
Reference in New Issue
Block a user