From a879613637f54a7a2016549b308b359b7577b5ad Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Tue, 5 Jul 2011 23:08:40 +0000 Subject: cli: Exit if glusterd is not operational in non-prompt modes Signed-off-by: Vijay Bellur Signed-off-by: Anand Avati BUG: 3120 (Provide connection timeout between cli and glusterd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3120 --- 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 491c11b4434..d55781e23e9 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