YUKI Hiroshi
null+****@clear*****
Tue Oct 7 10:17:32 JST 2014
YUKI Hiroshi 2014-10-07 10:17:32 +0900 (Tue, 07 Oct 2014) New Revision: 593b0e07d18aaf5dcb98c5edf5bd761be1f75c2b https://github.com/droonga/droonga-http-server/commit/593b0e07d18aaf5dcb98c5edf5bd761be1f75c2b Message: Create PID file directory by the service startup script. The directory is always removed by system on shutdown or startup. We have to prepare it on every startup. Modified files: install/centos/droonga-http-server install/centos/functions.sh install/debian/droonga-http-server install/debian/functions.sh Modified: install/centos/droonga-http-server (+5 -0) =================================================================== --- install/centos/droonga-http-server 2014-10-07 10:11:43 +0900 (834fd63) +++ install/centos/droonga-http-server 2014-10-07 10:17:32 +0900 (495fc63) @@ -20,6 +20,11 @@ cd $DROONGA_BASE_DIR PIDFILE=/run/$NAME/$NAME.pid DAEMON_ARGS="--daemon --pid-file=$PIDFILE" +# This directory is required to write PID file by non-root user. +pid_dir=/run/$NAME +mkdir -p $pid_dir +chown -R $USER:$GROUP $pid_dir + [ -x $DAEMON ] || exit 0 start() { Modified: install/centos/functions.sh (+0 -4) =================================================================== --- install/centos/functions.sh 2014-10-07 10:11:43 +0900 (b198969) +++ install/centos/functions.sh 2014-10-07 10:17:32 +0900 (3f5ed34) @@ -20,10 +20,6 @@ register_service() { #TODO: we should migrate to systemd in near future... - local pid_dir=/run/$NAME - mkdir -p $pid_dir - chown -R $USER:$GROUP $pid_dir - curl -o /etc/rc.d/init.d/$NAME $(download_url "install/centos/$NAME") if [ $? -ne 0 ]; then echo "ERROR: Failed to download service script!" Modified: install/debian/droonga-http-server (+5 -0) =================================================================== --- install/debian/droonga-http-server 2014-10-07 10:11:43 +0900 (79f45d8) +++ install/debian/droonga-http-server 2014-10-07 10:17:32 +0900 (8d9fc14) @@ -22,6 +22,11 @@ PIDFILE=/var/run/$NAME/$NAME.pid DAEMON_ARGS="--daemon --pid-file=$PIDFILE" SCRIPTNAME=/etc/init.d/$NAME +# This directory is required to write PID file by non-root user. +pid_dir=/var/run/$NAME +mkdir -p $pid_dir +chown -R $USER:$GROUP $pid_dir + # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 Modified: install/debian/functions.sh (+0 -4) =================================================================== --- install/debian/functions.sh 2014-10-07 10:11:43 +0900 (0c65ba7) +++ install/debian/functions.sh 2014-10-07 10:17:32 +0900 (5d754b4) @@ -18,10 +18,6 @@ register_service() { local USER=$2 local GROUP=$3 - local pid_dir=/var/run/$NAME - mkdir -p $pid_dir - chown -R $USER:$GROUP $pid_dir - curl -o /etc/init.d/$NAME $(download_url "install/debian/$NAME") if [ $? -ne 0 ]; then echo "ERROR: Failed to download service script!" -------------- next part -------------- HTML����������������������������... ダウンロード