diff options
author | Krishna Srinivas <ksriniva@redhat.com> | 2012-04-21 17:42:10 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-23 00:20:05 -0700 |
commit | f47b0fa1ccd594be9f0cda7f756973a04c0faed6 (patch) | |
tree | 14e19dacc50d386acc3cfc16d5301b8431a6a9c1 /xlators/nfs/server/src | |
parent | 66fddb979d7f33a86869211c06e4a9ef4a54a080 (diff) |
nfs/nlm: remove /var/run/rpc.statd.pid before starting rpc.statd.
Sometimes rpc.statd fails to start if rpc.statd.pid exists.
Change-Id: Ic6feb375330fceb8dd6c35330757738fb5cbe16f
BUG: 814265
Signed-off-by: Krishna Srinivas <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/3206
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Saurabh Jain <saurabh@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/nfs/server/src')
-rw-r--r-- | xlators/nfs/server/src/nlm4.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c index be5772837..3f8feee83 100644 --- a/xlators/nfs/server/src/nlm4.c +++ b/xlators/nfs/server/src/nlm4.c @@ -1868,11 +1868,18 @@ nlm4svc_init(xlator_t *nfsx) } /* temporary work around to restart statd, not distro/OS independant. * Need to figure out a more graceful way + * killall will cause problems on solaris. */ ret = runcmd ("killall", "-9", "rpc.statd", NULL); /* if ret == -1, do nothing - case statd was not already running */ - ret = runcmd ("rpc.statd", NULL); + ret = unlink ("/var/run/rpc.statd.pid"); + if (ret == -1 && errno != ENOENT) { + gf_log (GF_NLM, GF_LOG_ERROR, "unable to unlink rpc.statd"); + goto err; + } + + ret = runcmd ("/sbin/rpc.statd", NULL); if (ret == -1) { gf_log (GF_NLM, GF_LOG_ERROR, "unable to start rpc.statd"); goto err; |