From 1292e8991aab12ad40b5b37a85aaf6ed5e2f6b43 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 10 Aug 2017 22:43:05 +0900 Subject: [PATCH] Improve "standby switchover" --dry-run output --- repmgr-action-standby.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 36482ebe..51bfe64c 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -1994,10 +1994,16 @@ do_standby_switchover(void) */ if (runtime_options.dry_run == true) { + char shutdown_command[MAXLEN] = ""; + strncpy(shutdown_command, command_output.data, MAXLEN); + + termPQExpBuffer(&command_output); + + string_remove_trailing_newlines(shutdown_command); + log_info(_("following shutdown command would be run on node \"%s\":\n \"%s\""), remote_node_record.node_name, - command_output.data); - termPQExpBuffer(&command_output); + shutdown_command); return; }