mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-24 15:46:29 +00:00
Compare commits
6 Commits
v1.1.1
...
REL1_1_STA
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e04ba8bea5 | ||
|
|
031f9aedcc | ||
|
|
8ee715b657 | ||
|
|
c2344fe843 | ||
|
|
30b124e91f | ||
|
|
c00fa9f9ba |
18
repmgr.c
18
repmgr.c
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "d:h:p:U:D:f:R:w:F:I:v", long_options,
|
while ((c = getopt_long(argc, argv, "d:h:p:U:D:f:R:w:FIv", long_options,
|
||||||
&optindex)) != -1)
|
&optindex)) != -1)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
@@ -232,7 +233,7 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log_err(_("%s: too many command-line arguments (first extra is \"%s\")\n"),
|
log_err(_("%s: too many command-line arguments (first extra is \"%s\")\n"),
|
||||||
progname, argv[optind + 1]);
|
progname, argv[optind]);
|
||||||
usage();
|
usage();
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
@@ -861,6 +862,7 @@ do_standby_clone(void)
|
|||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* Trouble accessing directory */
|
/* Trouble accessing directory */
|
||||||
log_err(_("%s: could not access directory \"%s\": %s\n"),
|
log_err(_("%s: could not access directory \"%s\": %s\n"),
|
||||||
@@ -887,6 +889,16 @@ do_standby_clone(void)
|
|||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We need all 4 parameters, and they can be retrieved only by superusers */
|
||||||
|
if (PQntuples(res) != 4)
|
||||||
|
{
|
||||||
|
log_err("%s: STANDBY CLONE should be run by a SUPERUSER\n", progname);
|
||||||
|
PQclear(res);
|
||||||
|
PQfinish(conn);
|
||||||
|
exit(ERR_BAD_CONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < PQntuples(res); i++)
|
for (i = 0; i < PQntuples(res); i++)
|
||||||
{
|
{
|
||||||
if (strcmp(PQgetvalue(res, i, 0), "data_directory") == 0)
|
if (strcmp(PQgetvalue(res, i, 0), "data_directory") == 0)
|
||||||
@@ -1476,7 +1488,7 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
|
|||||||
maxlen_snprintf(rsync_flags, "%s", options.rsync_options);
|
maxlen_snprintf(rsync_flags, "%s", options.rsync_options);
|
||||||
|
|
||||||
if (runtime_options.force)
|
if (runtime_options.force)
|
||||||
strcat(rsync_flags, " --delete");
|
strcat(rsync_flags, " --delete --checksum");
|
||||||
|
|
||||||
if (!remote_user[0])
|
if (!remote_user[0])
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user