summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@zresearch.com>2009-03-31 10:56:10 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-01 13:20:06 +0530
commitdb365c30d07f5faae4197e37148f64e75b54a7ec (patch)
tree5ae79870edcebfabe588bdc91f71910d45f72fa8 /glusterfsd/src/glusterfsd.c
parentaa63a122433d51e89148af27dab98cf68846dab4 (diff)
Enable glusterfs client to exit after a configured number of failed connects \ while fetching volume specification file from server
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 37eefa01bec..d4ac16a3083 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -85,6 +85,10 @@ static struct argp_option gf_options[] = {
{"volfile-server", ARGP_VOLFILE_SERVER_KEY, "SERVER", 0,
"Server to get the volume file from. This option overrides "
"--volfile option"},
+ {"volfile-max-fetch-attempts", ARGP_VOLFILE_MAX_FETCH_ATTEMPTS,
+ "MAX-ATTEMPTS", 0, "Maximum number of connect attempts to server. "
+ "This option should be provided with --volfile-server option"
+ "[default: 1]"},
{"volfile", ARGP_VOLUME_FILE_KEY, "VOLFILE", 0,
"File to use as VOLUME_FILE [default: "DEFAULT_CLIENT_VOLUME_FILE" or "
DEFAULT_SERVER_VOLUME_FILE"]"},
@@ -659,7 +663,19 @@ parse_opts (int key, char *arg, struct argp_state *state)
case ARGP_VOLFILE_SERVER_KEY:
cmd_args->volfile_server = strdup (arg);
break;
+
+ case ARGP_VOLFILE_MAX_FETCH_ATTEMPTS:
+ n = 0;
+ if (gf_string2uint_base10 (arg, &n) == 0) {
+ cmd_args->max_connect_attempts = n;
+ break;
+ }
+
+ argp_failure (state, -1, 0,
+ "Invalid limit on connect attempts %s", arg);
+ break;
+
case ARGP_VOLUME_FILE_KEY:
cmd_args->volume_file = strdup (arg);
break;