Patchwork [BRANCH:release-3.1,BUG:2969] build : use pid file to kill nfs process

login
register
Submitter Lakshmipathi
Date 2011-06-17 11:42:47
Message ID <20110617114247.GA12773@shell.gluster.com>
Download mbox | patch
Permalink /patch/7541/
State Accepted
Headers show

Comments

Lakshmipathi - 2011-06-17 11:42:47
Signed-off-by: Lakshmipathi.G <lakshmipathi@gluster.com>
---
 extras/init.d/glusterd-Redhat.in |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

Patch

diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in
index 0c39ff1..229d531 100755
--- a/extras/init.d/glusterd-Redhat.in
+++ b/extras/init.d/glusterd-Redhat.in
@@ -34,8 +34,15 @@  stop()
        pidof -c -o %PPID -x $GLUSTERFSD &> /dev/null
        [ $? -eq 0 ] &&  killproc $GLUSTERFSD &> /dev/null
 
-       pidof -c -o %PPID -x $GLUSTERFS &> /dev/null
-       [ $? -eq 0 ] &&  killproc $GLUSTERFS &> /dev/null
+       
+       if [ -f /etc/glusterd/nfs/run/nfs.pid ] ;then
+       pid=`cat /etc/glusterd/nfs/run/nfs.pid`;
+       cmd=`ps -p $pid -o comm=`
+
+       if [ $cmd == "glusterfs" ]; then
+       kill $pid 
+       fi
+       fi 
 }