From 9c945fdebc195c030701257abf42c4959f97234e Mon Sep 17 00:00:00 2001 From: Pranith K Date: Thu, 10 Mar 2011 02:20:00 +0000 Subject: glusterfsd: translator info event handling implementation Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 1965 (need a cmd to get io-stat details) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1965 --- glusterfsd/src/glusterfsd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'glusterfsd/src/glusterfsd.c') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 87d16c7dc..2c723c9e2 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -133,6 +133,8 @@ static struct argp_option gf_options[] = { "Listening port number of log server"}, {"pid-file", ARGP_PID_FILE_KEY, "PIDFILE", 0, "File to use as pid file"}, + {"socket-file", ARGP_SOCK_FILE_KEY, "SOCKFILE", 0, + "File to use as unix-socket"}, {"no-daemon", ARGP_NO_DAEMON_KEY, 0, 0, "Run in foreground"}, {"run-id", ARGP_RUN_ID_KEY, "RUN-ID", OPTION_HIDDEN, @@ -187,6 +189,7 @@ static struct argp argp = { gf_options, parse_opts, argp_doc, gf_doc }; int glusterfs_pidfile_cleanup (glusterfs_ctx_t *ctx); int glusterfs_volumes_init (glusterfs_ctx_t *ctx); int glusterfs_mgmt_init (glusterfs_ctx_t *ctx); +int glusterfs_listener_init (glusterfs_ctx_t *ctx); int create_fuse_mount (glusterfs_ctx_t *ctx) @@ -565,6 +568,10 @@ parse_opts (int key, char *arg, struct argp_state *state) cmd_args->pid_file = gf_strdup (arg); break; + case ARGP_SOCK_FILE_KEY: + cmd_args->sock_file = gf_strdup (arg); + break; + case ARGP_NO_DAEMON_KEY: cmd_args->no_daemon_mode = ENABLE_NO_DAEMON_MODE; break; @@ -687,6 +694,9 @@ cleanup_and_exit (int signum) ctx->cleanup_started = 1; glusterfs_mgmt_pmap_signout (ctx); + if (ctx->listener) { + ctx->listener = NULL; + } /* Call fini() of FUSE xlator first: * so there are no more requests coming and @@ -1376,6 +1386,12 @@ glusterfs_volumes_init (glusterfs_ctx_t *ctx) cmd_args = &ctx->cmd_args; + if (cmd_args->sock_file) { + ret = glusterfs_listener_init (ctx); + if (ret) + goto out; + } + if (cmd_args->volfile_server) { ret = glusterfs_mgmt_init (ctx); goto out; -- cgit