[Groonga-commit] groonga/groonga [master] rpm centos: split groonga init script

Back to archive index

HAYASHI Kentaro null+****@clear*****
Mon Sep 24 14:56:44 JST 2012


HAYASHI Kentaro	2012-09-24 14:56:44 +0900 (Mon, 24 Sep 2012)

  New Revision: fbb23f89be8520b8fe04542b247e9ac5b3708c73
  https://github.com/groonga/groonga/commit/fbb23f89be8520b8fe04542b247e9ac5b3708c73

  Log:
    rpm centos: split groonga init script

  Copied files:
    data/init.d/redhat/groonga-server-gqtp
      (from data/init.d/redhat/groonga)
  Modified files:
    data/init.d/redhat/Makefile.am
  Renamed files:
    data/init.d/redhat/groonga-server-http
      (from data/init.d/redhat/groonga)

  Modified: data/init.d/redhat/Makefile.am (+1 -1)
===================================================================
--- data/init.d/redhat/Makefile.am    2012-09-24 14:35:49 +0900 (da8d336)
+++ data/init.d/redhat/Makefile.am    2012-09-24 14:56:44 +0900 (d63922a)
@@ -1,6 +1,6 @@
 SUBDIRS = sysconfig
 
-scripts = groonga groonga-httpd
+scripts = groonga-server-http groonga-server-gqtp groonga-httpd
 
 if REDHAT_PLATFORM
 initdir = $(sysconfdir)/init.d

  Copied: data/init.d/redhat/groonga-server-gqtp (+13 -17) 83%
===================================================================
--- data/init.d/redhat/groonga    2012-09-24 14:35:49 +0900 (4d62c16)
+++ data/init.d/redhat/groonga-server-gqtp    2012-09-24 14:56:44 +0900 (7e14a79)
@@ -1,15 +1,15 @@
 #!/bin/bash
 #
-# /etc/rc.d/init.d/groonga
+# /etc/rc.d/init.d/groonga-server-gqtp
 #
 # chkconfig: - 80 20
 # description: A full-text search engine and column store.
 # processname: groonga
-# config: /etc/sysconfig/groonga
-# pidfile: /var/run/groonga/groonga.pid
+# config: /etc/sysconfig/groonga-server-gqtp
+# pidfile: /var/run/groonga/groonga-gqtp.pid
 #
 ### BEGIN INIT INFO
-# Provides:          groonga
+# Provides:          groonga-server-gqtp
 # Default-Stop:      0 1 6
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
@@ -20,7 +20,7 @@
 # Source function library.
 . /etc/init.d/functions
 
-name="groonga"
+name="groonga-server-gqtp"
 prog="groonga"
 groonga=/usr/bin/$prog
 curl=/usr/bin/curl
@@ -28,11 +28,11 @@ USER=groonga
 GROUP=groonga
 DATABASE=/var/lib/groonga/db/db
 ADDRESS=127.0.0.1
-PORT=10041
-PIDFILE=/var/run/groonga/$prog.pid
+PORT=10043
+PIDFILE=/var/run/groonga/$prog-gqtp.pid
 PROTOCOL=http
-LOG_PATH=/var/log/groonga/groonga.log
-QUERY_LOG_PATH=/var/log/groonga/query.log
+LOG_PATH=/var/log/groonga/groonga-gqtp.log
+QUERY_LOG_PATH=/var/log/groonga/query-gqtp.log
 OPTION_ARGS=""
 
 if [ -f /etc/sysconfig/$name ]; then
@@ -108,11 +108,7 @@ RETVAL=0
 
 send_command() {
 	command=$1
-	if [ "${PROTOCOL}" = "http" ]; then
-		$curl "http://${ADDRESS}:${PORT}/d/${command}"
-	else
-		$groonga --port $PORT -c $ADDRESS ${command}
-	fi
+	$groonga --port $PORT -c $ADDRESS ${command}
 }
 
 start() {
@@ -120,7 +116,7 @@ start() {
 	daemon $DAEMON_ARGS $groonga "$GROONGA_ARGS"
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
 	return $RETVAL
 }
 
@@ -130,7 +126,7 @@ stop() {
 	killproc $prog
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
 	return $RETVAL
 }
 
@@ -157,7 +153,7 @@ case "$1" in
 	killproc $groonga -HUP
 	;;
     condrestart)
-	[ -f /var/lock/subsys/$prog ] && restart || :
+	[ -f /var/lock/subsys/$name ] && restart || :
 	;;
     status)
 	status

  Renamed: data/init.d/redhat/groonga-server-http (+12 -16) 84%
===================================================================
--- data/init.d/redhat/groonga    2012-09-24 14:35:49 +0900 (4d62c16)
+++ data/init.d/redhat/groonga-server-http    2012-09-24 14:56:44 +0900 (11477dd)
@@ -1,15 +1,15 @@
 #!/bin/bash
 #
-# /etc/rc.d/init.d/groonga
+# /etc/rc.d/init.d/groonga-server-http
 #
 # chkconfig: - 80 20
 # description: A full-text search engine and column store.
 # processname: groonga
-# config: /etc/sysconfig/groonga
-# pidfile: /var/run/groonga/groonga.pid
+# config: /etc/sysconfig/groonga-server-http
+# pidfile: /var/run/groonga/groonga-http.pid
 #
 ### BEGIN INIT INFO
-# Provides:          groonga
+# Provides:          groonga-server-http
 # Default-Stop:      0 1 6
 # Required-Start:    $remote_fs
 # Required-Stop:     $remote_fs
@@ -20,7 +20,7 @@
 # Source function library.
 . /etc/init.d/functions
 
-name="groonga"
+name="groonga-server-http"
 prog="groonga"
 groonga=/usr/bin/$prog
 curl=/usr/bin/curl
@@ -29,10 +29,10 @@ GROUP=groonga
 DATABASE=/var/lib/groonga/db/db
 ADDRESS=127.0.0.1
 PORT=10041
-PIDFILE=/var/run/groonga/$prog.pid
+PIDFILE=/var/run/groonga/$prog-http.pid
 PROTOCOL=http
-LOG_PATH=/var/log/groonga/groonga.log
-QUERY_LOG_PATH=/var/log/groonga/query.log
+LOG_PATH=/var/log/groonga/groonga-http.log
+QUERY_LOG_PATH=/var/log/groonga/query-http.log
 OPTION_ARGS=""
 
 if [ -f /etc/sysconfig/$name ]; then
@@ -108,11 +108,7 @@ RETVAL=0
 
 send_command() {
 	command=$1
-	if [ "${PROTOCOL}" = "http" ]; then
-		$curl "http://${ADDRESS}:${PORT}/d/${command}"
-	else
-		$groonga --port $PORT -c $ADDRESS ${command}
-	fi
+	$curl "http://${ADDRESS}:${PORT}/d/${command}"
 }
 
 start() {
@@ -120,7 +116,7 @@ start() {
 	daemon $DAEMON_ARGS $groonga "$GROONGA_ARGS"
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
 	return $RETVAL
 }
 
@@ -130,7 +126,7 @@ stop() {
 	killproc $prog
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
 	return $RETVAL
 }
 
@@ -157,7 +153,7 @@ case "$1" in
 	killproc $groonga -HUP
 	;;
     condrestart)
-	[ -f /var/lock/subsys/$prog ] && restart || :
+	[ -f /var/lock/subsys/$name ] && restart || :
 	;;
     status)
 	status
-------------- next part --------------
HTML����������������������������...
Descargar 



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