From 70d0d908766dd4cd7802c97ce3e817ee200e7483 Mon Sep 17 00:00:00 2001 From: Lakshmipathi Date: Fri, 17 Jun 2011 06:12:47 +0000 Subject: build : use pid file to kill nfs process Signed-off-by: Lakshmipathi.G Signed-off-by: Anand Avati BUG: 2969 (add --pidfile option) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2969 --- extras/init.d/glusterd-Redhat.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'extras') diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in index 0c39ff139..229d531bb 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 } -- cgit