Add diagnostic option "repmgr node check --has-passfile"

This checks if the active libpq version (9.6 and later) has the
"passfile" option, and returns 0 if present, 1 if not.
`
This commit is contained in:
Ian Barwick
2017-12-05 12:53:04 +09:00
parent 6e9e4543e8
commit 8c121da8a1
5 changed files with 27 additions and 5 deletions

View File

@@ -564,6 +564,15 @@ do_node_check(void)
CheckStatusListCell *cell = NULL;
/* internal */
if (runtime_options.has_passfile == true)
{
return_code = has_passfile() ? 0 : 1;
exit(return_code);
}
if (strlen(config_file_options.conninfo))
conn = establish_db_connection(config_file_options.conninfo, true);
else
@@ -587,8 +596,8 @@ do_node_check(void)
if (runtime_options.archive_ready == true)
{
return_code = do_node_check_archive_ready(conn,
runtime_options.output_mode,
NULL);
runtime_options.output_mode,
NULL);
PQfinish(conn);
exit(return_code);
}