summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-21 01:50:31 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-21 05:17:27 -0700
commitdaf868e13511d97492ca4ece5fe60a2a4f69a20f (patch)
treed0a222781b0fd99e2d713fdc8b7dcdc8c2f8631b /glusterfsd/src/glusterfsd.c
parentc429e47ae3925d0bc1ca113e37d903410f3e043a (diff)
portmapper program added to glusterfsd mgmt rpc
* some bug fixes glusterd-pmap.c * also renamed 'fetch-spec.c' -> 'glusterfsd-mgmt.c' Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1314 (portmapper functionality) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1314
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 6daeac1293e..c944075f76f 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -157,7 +157,11 @@ static struct argp_option gf_options[] = {
#else
"[default: \"off\"]"
#endif
- },
+ },
+ {"brick-name", ARGP_BRICK_NAME_KEY, "BRICK-NAME", OPTION_HIDDEN,
+ "Brick name to be registered with Gluster portmapper" },
+ {"brick-port", ARGP_BRICK_PORT_KEY, "BRICK-PORT", OPTION_HIDDEN,
+ "Brick Port to be registered with Gluster portmapper" },
{0, 0, 0, 0, "Fuse options:"},
{"direct-io-mode", ARGP_DIRECT_IO_MODE_KEY, "BOOL", OPTION_ARG_OPTIONAL,
@@ -574,6 +578,20 @@ parse_opts (int key, char *arg, struct argp_state *state)
case ARGP_DUMP_FUSE_KEY:
cmd_args->dump_fuse = gf_strdup (arg);
break;
+ case ARGP_BRICK_NAME_KEY:
+ cmd_args->brick_name = gf_strdup (arg);
+ break;
+ case ARGP_BRICK_PORT_KEY:
+ n = 0;
+
+ if (gf_string2uint_base10 (arg, &n) == 0) {
+ cmd_args->brick_port = n;
+ break;
+ }
+
+ argp_failure (state, -1, 0,
+ "unknown brick (listen) port %s", arg);
+ break;
}
return 0;
@@ -588,13 +606,16 @@ cleanup_and_exit (int signum)
ctx = glusterfs_ctx_get ();
+ /* TODO: is this the right place? */
+ glusterfs_mgmt_pmap_signout (ctx);
+
gf_log ("glusterfsd", GF_LOG_NORMAL, "shutting down");
tmp_pool = ctx->pool;
mem_pool_destroy (tmp_pool->frame_mem_pool);
mem_pool_destroy (tmp_pool->stack_mem_pool);
tmp_pool = NULL;
- mem_pool_destroy (ctx->stub_mem_pool);
+ mem_pool_destroy (ctx->stub_mem_pool);
glusterfs_pidfile_cleanup (ctx);