[Groonga-commit] groonga/groonga [master] [centos] support status.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 2月 1日 (水) 18:12:50 JST


Kouhei Sutou	2012-02-01 18:12:50 +0900 (Wed, 01 Feb 2012)

  New Revision: 85cfae7dadf839f3d8839b84537268487584feb6

  Log:
    [centos] support status.

  Modified files:
    data/init.d/redhat/groonga
    data/init.d/redhat/sysconfig/groonga

  Modified: data/init.d/redhat/groonga (+8 -4)
===================================================================
--- data/init.d/redhat/groonga    2012-02-01 18:08:03 +0900 (7035abe)
+++ data/init.d/redhat/groonga    2012-02-01 18:12:50 +0900 (7ff278d)
@@ -27,6 +27,7 @@ USER=groonga
 GROUP=groonga
 DATABASE=/var/lib/groonga/db/db
 ADDRESS=127.0.0.1
+PORT=10041
 PIDFILE=/var/run/groonga/$prog.pid
 PROTOCOL=http
 LOG_PATH=/var/log/groonga/groonga.log
@@ -62,6 +63,9 @@ fi
 if [ -n "${ADDRESS}" ]; then
 	GROONGA_ARGS="${GROONGA_ARGS} --address ${ADDRESS}"
 fi
+if [ -n "${PORT}" ]; then
+	GROONGA_ARGS="${GROONGA_ARGS} --port ${PORT}"
+fi
 if [ -n "${LOG_PATH}" ]; then
 	mkdir -p $(dirname ${LOG_PATH})
 	if [ -n "${USER}" ]; then
@@ -126,11 +130,11 @@ restart() {
 }
 
 status() {
-	ARGS=""
-	if [ -n "${PROTOCOL}" ]; then
-		ARGS="${ARGS} --protocol ${PROTOCOL}"
+	if [ "${PROTOCOL}" = "http" ]; then
+		/usr/bin/curl "http://${ADDRESS}:${PORT}/d/status"
+	else
+		$groonga --port $PORT -c $ADDRESS status
 	fi
-	$groonga $ARGS -c $ADDRESS status
 }
 
 case "$1" in

  Modified: data/init.d/redhat/sysconfig/groonga (+1 -0)
===================================================================
--- data/init.d/redhat/sysconfig/groonga    2012-02-01 18:08:03 +0900 (e466804)
+++ data/init.d/redhat/sysconfig/groonga    2012-02-01 18:12:50 +0900 (da443c4)
@@ -2,6 +2,7 @@
 #USER=groonga
 #GROUP=groonga
 #ADDRESS=127.0.0.1
+#PORT=10041
 #DATABASE=/var/lib/groonga/db/db
 #LOG_PATH=/var/log/groonga/groonga.log
 #QUERY_LOG_PATH=/var/log/groonga/query.log




Groonga-commit メーリングリストの案内
Back to archive index