Add "-o ConnectTimeout=10" as default in "ssh_options"

This commit is contained in:
Ian Barwick
2017-09-13 13:23:16 +09:00
parent f194c254b8
commit 55f203a2fc
3 changed files with 23 additions and 11 deletions

View File

@@ -254,9 +254,6 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
*------------------------
*/
options->use_replication_slots = false;
memset(options->rsync_options, 0, sizeof(options->rsync_options));
memset(options->ssh_options, 0, sizeof(options->ssh_options));
strncpy(options->ssh_options, "-q", sizeof(options->ssh_options));
memset(options->replication_user, 0, sizeof(options->replication_user));
memset(options->pg_basebackup_options, 0, sizeof(options->pg_basebackup_options));
memset(options->restore_command, 0, sizeof(options->restore_command));
@@ -316,9 +313,18 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
* barman settings
* ---------------
*/
memset(options->barman_host, 0, sizeof(options->barman_host));
memset(options->barman_server, 0, sizeof(options->barman_server));
memset(options->barman_config, 0, sizeof(options->barman_config));
/*-------------------
* rsync/ssh settings
* ------------------
*/
memset(options->rsync_options, 0, sizeof(options->rsync_options));
memset(options->ssh_options, 0, sizeof(options->ssh_options));
strncpy(options->ssh_options, "-q -o ConnectTimeout=10", sizeof(options->ssh_options));
/*---------------------------
* undocumented test settings
*---------------------------
@@ -422,10 +428,6 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
/* standby clone settings */
else if (strcmp(name, "use_replication_slots") == 0)
options->use_replication_slots = parse_bool(value, name, error_list);
else if (strcmp(name, "rsync_options") == 0)
strncpy(options->rsync_options, value, MAXLEN);
else if (strcmp(name, "ssh_options") == 0)
strncpy(options->ssh_options, value, MAXLEN);
else if (strcmp(name, "pg_basebackup_options") == 0)
strncpy(options->pg_basebackup_options, value, MAXLEN);
else if (strcmp(name, "tablespace_mapping") == 0)
@@ -527,6 +529,12 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
else if (strcmp(name, "barman_config") == 0)
strncpy(options->barman_config, value, MAXLEN);
/* rsync/ssh settings */
else if (strcmp(name, "rsync_options") == 0)
strncpy(options->rsync_options, value, MAXLEN);
else if (strcmp(name, "ssh_options") == 0)
strncpy(options->ssh_options, value, MAXLEN);
/* undocumented settings for testing */
else if (strcmp(name, "promote_delay") == 0)
options->promote_delay = repmgr_atoi(value, name, error_list, 1);

View File

@@ -84,8 +84,6 @@ typedef struct
/* standby action settings */
bool use_replication_slots;
char rsync_options[MAXLEN];
char ssh_options[MAXLEN];
char pg_basebackup_options[MAXLEN];
char restore_command[MAXLEN];
TablespaceList tablespace_mapping;
@@ -135,6 +133,10 @@ typedef struct
char barman_server[MAXLEN];
char barman_config[MAXLEN];
/* rsync/ssh settings */
char rsync_options[MAXLEN];
char ssh_options[MAXLEN];
/* undocumented test settings */
int promote_delay;
} t_configuration_options;
@@ -150,7 +152,7 @@ typedef struct
/* log settings */ \
"", "", "", DEFAULT_LOG_STATUS_INTERVAL, \
/* standby action settings */ \
false, "", "", "", "", { NULL, NULL }, "", false, \
false, "", "", { NULL, NULL }, "", false, \
/* node check settings */ \
DEFAULT_ARCHIVE_READY_WARNING, DEFAULT_ARCHIVE_READY_CRITICAL, \
DEFAULT_REPLICATION_LAG_WARNING, DEFAULT_REPLICATION_LAG_CRITICAL, \
@@ -171,6 +173,8 @@ typedef struct
"", "", { NULL, NULL }, \
/* barman settings */ \
"", "", "", \
/* rsync/ssh settings */ \
"", "", \
/* undocumented test settings */ \
0 \
}

View File

@@ -151,7 +151,7 @@
#pg_ctl_options='' # Options to append to "pg_ctl"
#pg_basebackup_options='' # Options to append to "pg_basebackup"
#rsync_options='' # Options to append to "rsync"
ssh_options='-q' # Options to append to "ssh"
ssh_options='-q -o ConnectTimeout=10' # Options to append to "ssh"