summaryrefslogtreecommitdiffstats
path: root/cli/src/cli.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2011-07-07 03:45:57 +0000
committerAnand Avati <avati@gluster.com>2011-07-11 03:57:23 -0700
commit6cebcc568fba79e3496972fc50ae55a7812859ee (patch)
tree9ca9e920606d174175f9a29fd451369c2e3ca42f /cli/src/cli.c
parent9daafdeed31ca210b27392d114edfb93e74575e7 (diff)
cli: Exit if glusterd is not operational in non-prompt modes
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3120 (Provide connection timeout between cli and glusterd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3120
Diffstat (limited to 'cli/src/cli.c')
-rw-r--r--cli/src/cli.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c
index 709110150..ac0d768e4 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -349,6 +349,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;
}