From 5aed416a5f61b18a7eb105fde0752d1f66c37a88 Mon Sep 17 00:00:00 2001 From: Sachidananda Urs Date: Wed, 23 Nov 2011 00:02:33 +0530 Subject: 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 Reviewed-by: Harshavardhana Tested-by: Harshavardhana Reviewed-by: Kaleb KEITHLEY Reviewed-by: Anand Avati --- extras/init.d/glusterd-Redhat.in | 70 ++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'extras/init.d/glusterd-Redhat.in') diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in index 6e1260e5c..01a300947 100755 --- a/extras/init.d/glusterd-Redhat.in +++ b/extras/init.d/glusterd-Redhat.in @@ -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 -- cgit