From f47b0fa1ccd594be9f0cda7f756973a04c0faed6 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Sat, 21 Apr 2012 17:42:10 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3206 Tested-by: Gluster Build System Tested-by: Saurabh Jain Reviewed-by: Vijay Bellur --- xlators/nfs/server/src/nlm4.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xlators/nfs/server') diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c index be577283707..3f8feee8330 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; -- cgit