pgpool2.git / summary / log / commit / refs

commit    6d6afb6ebffa45d32f05288dd0ab2235a495c0ed
Author:   Yugo Nagata <nagata@sraoss.co.jp>
Date:     Fri Jan 24 05:16:32 2014 +0000

    Fix to output error message when wd_escalation_command fails with code other than 0


src/watchdog/wd_packet.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/watchdog/wd_packet.c b/src/watchdog/wd_packet.c index 58daa8d08..e09dce757 100644 --- a/src/watchdog/wd_packet.c +++ b/src/watchdog/wd_packet.c @@ -931,7 +931,17 @@ wd_escalation(void) /* execute escalation command */ if (strlen(pool_config->wd_escalation_command)) { - system(pool_config->wd_escalation_command); + int r; + r = system(pool_config->wd_escalation_command); + if (WIFEXITED(r)) + { + if (WEXITSTATUS(r) == EXIT_SUCCESS) + pool_log("wd_escalation: escalation command succeeded"); + else + pool_error("wd_escalation: escalation command failed. exit status: %d", WEXITSTATUS(r)); + } + else + pool_error("wd_escalation: escalation command exit abnormally"); } /* interface up as delegate IP */ [parent: 1c18d626065e]