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

login
register
Submitter Lakshmipathi
Date 2011-06-07 09:21:19
Message ID <20110607092119.GA27243@shell.gluster.com>
Download mbox | patch
Permalink /patch/7396/
State Accepted
Headers show

Comments

Lakshmipathi - 2011-06-07 09:21:19
Signed-off-by: Lakshmipathi.G <lakshmipathi@gluster.com>
---
 extras/init.d/glusterd-Redhat.in |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Patch

diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in
index 0c39ff1..6e1260e 100755
--- a/extras/init.d/glusterd-Redhat.in
+++ b/extras/init.d/glusterd-Redhat.in
@@ -34,8 +34,17 @@  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
+       #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 `cat /etc/glusterd/nfs/run/nfs.pid` 
+       fi
+       fi 
 }