pgpool2.git / summary / log / commit / refs

commit    b799b1ffdd5d7d036ef99839e6a3e919ffe113be
Author:   Yugo Nagata <nagata@sraoss.co.jp>
Commit:   Muhammad Usama <m.usama@gmail.com>
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: 2dc5d0c15562]