diff options
author | Csaba Henk <csaba@gluster.com> | 2010-07-24 13:36:46 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-28 23:58:18 -0700 |
commit | d5dd69dc2045fefb3f407689535a09a115206e4c (patch) | |
tree | ed406fb811ac93e22c4bb6a82205a5ba10b91fcf /glusterfsd | |
parent | 539a217dba16fcf3399a1ff29efe73e07fe5a0d7 (diff) |
make glusterfs work with autofs5
autofs5 blocks all processes which try to access the fs, except
for the one spawned by it (which one is expected to perform
the mount). Therefore our autofs4 workaround -- after daemonization,
original process waits for mounting to happen before exit --
does not work anymore. We need to do the mount in the original
process itself.
So we split glusterfs_graph_init() and move the fuse related part
before daemonization.
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1043 (autofs access hangs)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1043
Diffstat (limited to 'glusterfsd')
-rw-r--r-- | glusterfsd/src/glusterfsd.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index bf0d092b0fb..3751a7c8e25 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -640,7 +640,7 @@ glusterfs_graph_parent_up (xlator_t *graph) } int -glusterfs_graph_init (xlator_t *graph, int fuse) +glusterfs_graph_init_fuse (xlator_t *graph, int fuse) { volume_opt_list_t *vol_opt = NULL; @@ -661,6 +661,13 @@ glusterfs_graph_init (xlator_t *graph, int fuse) graph->ready = 1; } + + return 0; +} + +int +glusterfs_graph_init (xlator_t *graph) +{ if (_xlator_graph_init (graph) == -1) return -1; @@ -1305,6 +1312,18 @@ main (int argc, char *argv[]) gf_log ("glusterfs", GF_LOG_ERROR, "exiting"); return -1; } + fuse_volume_found = 1; + } + + /* override xlator options with command line options + * where applicable + */ + gf_add_cmdline_options (graph, cmd_args); + + if (glusterfs_graph_init_fuse (graph, fuse_volume_found) != 0) { + gf_log ("glusterfs", GF_LOG_ERROR, + "fuse translator initialization failed. exiting"); + return -1; } /* daemonize now */ @@ -1384,13 +1403,8 @@ main (int argc, char *argv[]) gf_timer_registry_init (ctx); - /* override xlator options with command line options - * where applicable - */ - gf_add_cmdline_options (graph, cmd_args); - ctx->graph = graph; - if (glusterfs_graph_init (graph, fuse_volume_found) != 0) { + if (glusterfs_graph_init (graph) != 0) { gf_log ("glusterfs", GF_LOG_ERROR, "translator initialization failed. exiting"); if (!cmd_args->no_daemon_mode && |