mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
Add -w option to pg_ctl commands so we wait until command is finish.
Or at least, we try. By default, after 60 seconds pg_ctl just return. This make useless to wait ourselves after pg_ctl start of witness so remove the sleep
This commit is contained in:
7
repmgr.c
7
repmgr.c
@@ -1356,7 +1356,7 @@ do_standby_follow(void)
|
|||||||
|
|
||||||
/* Finally, restart the service */
|
/* Finally, restart the service */
|
||||||
/* We assume the pg_ctl script is in the PATH */
|
/* We assume the pg_ctl script is in the PATH */
|
||||||
maxlen_snprintf(script, "pg_ctl -D %s -m fast restart", data_dir);
|
maxlen_snprintf(script, "pg_ctl -w -D %s -m fast restart", data_dir);
|
||||||
r = system(script);
|
r = system(script);
|
||||||
if (r != 0)
|
if (r != 0)
|
||||||
{
|
{
|
||||||
@@ -1519,7 +1519,7 @@ do_witness_create(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* start new instance */
|
/* start new instance */
|
||||||
sprintf(script, "pg_ctl -D %s start", runtime_options.dest_dir);
|
sprintf(script, "pg_ctl -w -D %s start", runtime_options.dest_dir);
|
||||||
log_info(_("Start cluster for witness: %s"), script);
|
log_info(_("Start cluster for witness: %s"), script);
|
||||||
r = system(script);
|
r = system(script);
|
||||||
if (r != 0)
|
if (r != 0)
|
||||||
@@ -1542,9 +1542,6 @@ do_witness_create(void)
|
|||||||
exit(ERR_DB_QUERY);
|
exit(ERR_DB_QUERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Let the server start */
|
|
||||||
sleep(2);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
create the local user and local db if it is not the default one
|
create the local user and local db if it is not the default one
|
||||||
values[2] is the username we use to connect to master,
|
values[2] is the username we use to connect to master,
|
||||||
|
|||||||
Reference in New Issue
Block a user