exit with status 2 if manual work is needed during standby_clone

This commit is contained in:
Charles Duffy
2011-02-06 15:05:34 -06:00
committed by Greg Smith
parent a02cd43115
commit 7e7c45c61d
2 changed files with 18 additions and 14 deletions

View File

@@ -970,7 +970,7 @@ stop_backup:
/* If the rsync failed then exit */ /* If the rsync failed then exit */
if (r != 0) if (r != 0)
exit(ERR_BAD_CONFIG); exit(ERR_BAD_RSYNC);
if (runtime_options.verbose) if (runtime_options.verbose)
printf(_("%s requires primary to keep WAL files %s until at least %s\n"), printf(_("%s requires primary to keep WAL files %s until at least %s\n"),
@@ -982,18 +982,21 @@ stop_backup:
{ {
log_err(_("%s: couldn't create directory %s, you will need to do it manually...\n"), log_err(_("%s: couldn't create directory %s, you will need to do it manually...\n"),
progname, runtime_options.dest_dir); progname, runtime_options.dest_dir);
r = ERR_NEEDS_XLOG; /* continue, but eventually exit returning error */
} }
/* Finally, write the recovery.conf file */ /* Finally, write the recovery.conf file */
create_recovery_file(runtime_options.dest_dir); create_recovery_file(runtime_options.dest_dir);
}
PQclear(res); PQclear(res);
PQfinish(conn); PQfinish(conn);
/* We don't start the service because we still may want to move the directory */ /*
return; * We don't start the service yet because we still may want to
* move the directory
*/
exit(r);
} }

View File

@@ -51,6 +51,7 @@
#define ERR_BAD_RSYNC 2 #define ERR_BAD_RSYNC 2
#define ERR_STOP_BACKUP 3 #define ERR_STOP_BACKUP 3
#define ERR_NO_RESTART 4 #define ERR_NO_RESTART 4
#define ERR_NEEDS_XLOG 5
/* Run time options type */ /* Run time options type */
typedef struct { typedef struct {