summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrishna Srinivas <ksriniva@redhat.com>2012-04-17 23:58:08 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-18 23:41:35 -0700
commit1b8f254daf05f84ebc3170e7b840608fc7baf068 (patch)
tree79a5a076aff8425e7d68d4a39ef15e33b13705db /xlators
parentc9a8da5bb8c78aba4b2477c011e2a4f335351fd8 (diff)
nfs/nlm: disable NLM if rpc.statd is not found.
Change-Id: I571e1f14cefdfabecd8996b6d0ffc928464d2b51 BUG: 813258 Signed-off-by: Krishna Srinivas <ksriniva@redhat.com> Reviewed-on: http://review.gluster.com/3174 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/nfs/server/src/nfs.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index d4feded..42edc95 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -180,8 +180,6 @@ nfs_add_all_initiators (struct nfs_state *nfs)
" initializer");
goto ret;
}
- } else {
- gf_log (GF_NFS, GF_LOG_INFO, "NLM is manually disabled");
}
ret = 0;
@@ -512,6 +510,7 @@ nfs_init_state (xlator_t *this)
unsigned int fopspoolsize = 0;
char *optstr = NULL;
gf_boolean_t boolt = _gf_false;
+ struct stat stbuf = {0,};
if (!this)
return NULL;
@@ -584,8 +583,10 @@ nfs_init_state (xlator_t *this)
goto free_foppool;
}
- if (boolt == _gf_false)
+ if (boolt == _gf_false) {
+ gf_log (GF_NFS, GF_LOG_INFO, "NLM is manually disabled");
nfs->enable_nlm = _gf_false;
+ }
}
nfs->enable_ino32 = 0;
@@ -710,6 +711,12 @@ nfs_init_state (xlator_t *this)
}
}
+ if (stat("/sbin/rpc.statd", &stbuf) == -1) {
+ gf_log (GF_NFS, GF_LOG_WARNING, "/sbin/rpc.statd not found. "
+ "Disabling NLM");
+ nfs->enable_nlm = _gf_false;
+ }
+
nfs->rpcsvc = rpcsvc_init (this, this->ctx, this->options, 0);
if (!nfs->rpcsvc) {
ret = -1;