build : use pid file to kill nfs process

Signed-off-by: Lakshmipathi.G <lakshmipathi@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>

BUG: 2969 (add --pidfile option)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2969
This commit is contained in:
Lakshmipathi 2011-06-07 03:47:11 +00:00 committed by Anand Avati
parent 2b53a40350
commit 29397bda24

View File

@ -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
}