[Groonga-commit] droonga/droonga-engine at 43b6e1f [master] Put PID file for CentOS under /run/

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Sep 25 12:53:27 JST 2014


YUKI Hiroshi	2014-09-25 12:53:27 +0900 (Thu, 25 Sep 2014)

  New Revision: 43b6e1ffb0fae81955ab7679591d515590377cd8
  https://github.com/droonga/droonga-engine/commit/43b6e1ffb0fae81955ab7679591d515590377cd8

  Message:
    Put PID file for CentOS under /run/

  Modified files:
    install.sh
    install/centos/droonga-engine

  Modified: install.sh (+4 -0)
===================================================================
--- install.sh    2014-09-25 12:28:40 +0900 (41038cd)
+++ install.sh    2014-09-25 12:53:27 +0900 (9f745f3)
@@ -251,6 +251,10 @@ prepare_environment_in_centos() {
 }
 
 register_service_in_centos() {
+  pid_dir=/run/$NAME
+  mkdir -p $pid_dir
+  chown -R $USER:$GROUP $pid_dir
+
   install_service_script /etc/rc.d/init.d/$NAME centos
   /sbin/chkconfig --add $NAME
 }

  Modified: install/centos/droonga-engine (+4 -3)
===================================================================
--- install/centos/droonga-engine    2014-09-25 12:28:40 +0900 (e49d6b1)
+++ install/centos/droonga-engine    2014-09-25 12:53:27 +0900 (d6520a7)
@@ -13,13 +13,14 @@ USER=$NAME
 GROUP=droonga
 DAEMON=/usr/local/bin/$NAME
 export DROONGA_BASE_DIR=/home/$NAME/droonga
-DAEMON_ARGS="--daemon --pid-file=$NAME"
+PIDFILE=/run/$NAME/$NAME.pid
+DAEMON_ARGS="--daemon --pid-file=$PIDFILE"
 
 [ -x $DAEMON ] || exit 0
 
 start() {
 	echo -n "Starting $NAME: "
-  daemon --user $USER $DAEMON $DAEMON_ARGS
+  daemon --user $USER --pidfile $PIDFILE $DAEMON $DAEMON_ARGS
   RET_CODE=$?
   touch /var/lock/subsys/$NAME
 	return $RET_CODE
@@ -27,7 +28,7 @@ start() {
 
 stop() {
 	echo -n "Shutting down $NAME: "
-	killproc $DAEMON
+	killproc -p $PIDFILE $DAEMON
   RET_CODE=$?
   rm -f /var/lock/subsys/$NAME
 	return $RET_CODE
-------------- next part --------------
HTML����������������������������...
Download 



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