[Groonga-commit] groonga/groonga at 3f493a9 [master] stop,restart時ha

Back to archive index

jacob16bit null+****@clear*****
Fri Jul 3 17:59:49 JST 2015


jacob16bit	2015-07-03 17:59:49 +0900 (Fri, 03 Jul 2015)

  New Revision: 3f493a900cbb9f1361ed3f0b69ca71e4dfbbbac8
  https://github.com/groonga/groonga/commit/3f493a900cbb9f1361ed3f0b69ca71e4dfbbbac8

  Merged 6ebbabf: Merge pull request #357 from jacob16bit/initscript

  Message:
    stop,restart時ha

  Modified files:
    data/init.d/redhat/groonga-httpd

  Modified: data/init.d/redhat/groonga-httpd (+6 -21)
===================================================================
--- data/init.d/redhat/groonga-httpd    2015-07-03 15:48:49 +0900 (f596ed8)
+++ data/init.d/redhat/groonga-httpd    2015-07-03 17:59:49 +0900 (189b3cb)
@@ -35,7 +35,8 @@ DAEMON_ARGS=""
 RETVAL=0
 
 start() {
-	echo -n "Starting $name: "
+	echo -n $"Starting $prog: "
+	[ -f /var/lock/subsys/$prog ] && passed && echo && exit 0
 	daemon $DAEMON_ARGS ${GROONGA_HTTPD} ${GROONGA_HTTPD_ARGS}
 	RETVAL=$?
 	echo
@@ -44,32 +45,16 @@ start() {
 }
 
 stop() {
-	echo -n "Shutting down $name: "
-	${GROONGA_HTTPD} -s stop
+	action $"Stopping $prog: " ${GROONGA_HTTPD} -s stop
 	RETVAL=$?
-	if [ $RETVAL -eq 0 ]; then
-		rm -f /var/lock/subsys/$prog
-		success
-		echo
-	else
-		failure
-		echo
-	fi
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
 	return $RETVAL
 }
 
 restart() {
-	echo -n "Restarting $name: "
-	${GROONGA_HTTPD_RESTART}
+	action $"Reloading $prog: " ${GROONGA_HTTPD_RESTART}
 	RETVAL=$?
-	if [ $RETVAL -eq 0 ]; then
-		touch /var/lock/subsys/$prog
-		success
-		echo
-	else
-		failure
-		echo
-	fi
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
 	return $RETVAL
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index