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:
Jaime Casanova
2011-11-27 18:28:55 -05:00
parent 9b8fb7e960
commit 7077a7c68f

View File

@@ -1356,7 +1356,7 @@ do_standby_follow(void)
/* Finally, restart the service */
/* 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);
if (r != 0)
{
@@ -1519,7 +1519,7 @@ do_witness_create(void)
}
/* 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);
r = system(script);
if (r != 0)
@@ -1542,9 +1542,6 @@ do_witness_create(void)
exit(ERR_DB_QUERY);
}
/* Let the server start */
sleep(2);
/*
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,