From 1acef91232abbeb5fbf9a5fce2c71cba0df2a86c Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 22 Aug 2011 20:28:50 +0530 Subject: cli: Exit if glusterd is not operational in non-prompt modes Change-Id: Icab7965f570e3c422e5b18b89bc418f3598c2c4d BUG: 3120 Reviewed-on: http://review.gluster.com/297 Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- cli/src/cli.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/src/cli.c') diff --git a/cli/src/cli.c b/cli/src/cli.c index e4e7444e8..7341c7e8f 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -352,6 +352,12 @@ cli_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, { gf_log (this->name, GF_LOG_TRACE, "got RPC_CLNT_DISCONNECT"); connected = 0; + if (!global_state->prompt && global_state->await_connected) { + ret = 1; + cli_out ("Connection failed. Please check if gluster " + "daemon is operational."); + exit (ret); + } break; } -- cgit