Change the start/stop order of glusterd script at boot time.

In cases of client and server sharing the same machine, mounting GlusterFS at
boot time failed due to the start and stop order we use for glusterd. And people
had to resort to the idea of adding mount command in rc.local.

Currently the start and stop order at the boot time were 90 and 12, and netfs
started before `glusterd' and failed to mount GlusterFS. By changing
the rc order to 20 80 glusterd is started earlier than netfs, thus enabling
netfs to mount GlusterFS during boot process.

Thanks to: alex@net13.info for the suggestion in bug 2484.

Change-Id: I482f4dac5e5dd8bc5b8f5034c394f5dbe6c1fd3e
BUG: 2484
Reviewed-on: http://review.gluster.com/746
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <fharshav@redhat.com>
Tested-by: Harshavardhana <fharshav@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@gluster.com>
This commit is contained in:
Sachidananda Urs 2011-11-23 00:02:33 +05:30 committed by Anand Avati
parent 9ac21b5a3e
commit 5aed416a5f

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# chkconfig: 35 90 12
# chkconfig: 35 20 80
# description: Gluster File System service for volume management
#
@ -18,54 +18,54 @@ RETVAL=0
# Start the service $BASE
start()
{
echo -n $"Starting $BASE:"
daemon $GLUSTERD
RETVAL=$?
echo
[ $RETVAL -ne 0 ] && exit $RETVAL
echo -n $"Starting $BASE:"
daemon $GLUSTERD
RETVAL=$?
echo
[ $RETVAL -ne 0 ] && exit $RETVAL
}
# Stop the service $BASE
stop()
{
echo -n $"Stopping $BASE:"
killproc $BASE
echo
pidof -c -o %PPID -x $GLUSTERFSD &> /dev/null
[ $? -eq 0 ] && killproc $GLUSTERFSD &> /dev/null
echo -n $"Stopping $BASE:"
killproc $BASE
echo
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 `cat /etc/glusterd/nfs/run/nfs.pid`
fi
fi
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
}
### service arguments ###
case $1 in
start)
start
;;
stop)
stop
;;
status)
status $BASE
;;
restart)
$0 stop
$0 start
;;
*)
echo $"Usage: $0 {start|stop|status|restart}."
exit 1
start)
start
;;
stop)
stop
;;
status)
status $BASE
;;
restart)
$0 stop
$0 start
;;
*)
echo $"Usage: $0 {start|stop|status|restart}."
exit 1
esac
exit 0