From 1b8f254daf05f84ebc3170e7b840608fc7baf068 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Tue, 17 Apr 2012 23:58:08 +0530 Subject: nfs/nlm: disable NLM if rpc.statd is not found. Change-Id: I571e1f14cefdfabecd8996b6d0ffc928464d2b51 BUG: 813258 Signed-off-by: Krishna Srinivas Reviewed-on: http://review.gluster.com/3174 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/nfs/server/src/nfs.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'xlators') diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index d4feded24e2..42edc95f6d1 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; -- cgit