Kouhei Sutou
kou****@clear*****
Tue Oct 7 10:03:37 JST 2014
> /var/run/* are automatically removed on shutdown or next startup of the computer, so, after restarting droonga-engine couldn't start!! え、これ、どういうことですか? PIDファイルがないとdroonga-engineが起動できないってことです か?それはdroonga-engineが悪そうな気がしますけど。。。 それとも、/var/run/droonga-engine/みたいなディレクトリーがな くなるってことですか?であれば、起動スクリプトの中で作るのが いいんじゃないかと思いました。 他のサービスは/var/run/droonga-engine/みたいなディレクトリー にPIDファイルをぶちこんでいるんですよね?であれば、システム にサービスとして登録するならdroonga-engineもその流儀にのっとっ た方が使う人にとってうれしい挙動だと思います。 他のサービスがどうやっているかを見てみるといいんですかねぇ。 In <a31e1dc7be8dc784348c791c95984a1ac7dd6b5d �� jenkins.clear-code.com> "[Groonga-commit] droonga/droonga-engine �� a31e1dc [master] Put PID file under DROONGA_BASE_DIR." on Mon, 06 Oct 2014 21:27:03 +0900, SHIMODA "Piro" Hiroshi <null+groonga �� clear-code.com> wrote: > SHIMODA "Piro" Hiroshi 2014-10-06 21:27:03 +0900 (Mon, 06 Oct 2014) > > New Revision: a31e1dc7be8dc784348c791c95984a1ac7dd6b5d > https://github.com/droonga/droonga-engine/commit/a31e1dc7be8dc784348c791c95984a1ac7dd6b5d > > Message: > Put PID file under DROONGA_BASE_DIR. > > /var/run/* are automatically removed on shutdown or next startup of the computer, so, after restarting droonga-engine couldn't start!! > > Modified files: > install/centos/droonga-engine > install/centos/functions.sh > install/debian/droonga-engine > install/debian/functions.sh > > Modified: install/centos/droonga-engine (+1 -1) > =================================================================== > --- install/centos/droonga-engine 2014-10-06 18:51:05 +0900 (b5af009) > +++ install/centos/droonga-engine 2014-10-06 21:27:03 +0900 (c48588f) > @@ -17,7 +17,7 @@ GROUP=droonga > DAEMON=/usr/local/bin/$NAME > export DROONGA_BASE_DIR=/home/$NAME/droonga > cd $DROONGA_BASE_DIR > -PIDFILE=/run/$NAME/$NAME.pid > +PIDFILE=$DROONGA_BASE_DIR/$NAME.pid > DAEMON_ARGS="--daemon --pid-file=$PIDFILE" > > [ -x $DAEMON ] || exit 0 > > Modified: install/centos/functions.sh (+0 -4) > =================================================================== > --- install/centos/functions.sh 2014-10-06 18:51:05 +0900 (b198969) > +++ install/centos/functions.sh 2014-10-06 21:27:03 +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-engine (+1 -1) > =================================================================== > --- install/debian/droonga-engine 2014-10-06 18:51:05 +0900 (4b96c26) > +++ install/debian/droonga-engine 2014-10-06 21:27:03 +0900 (b205d8b) > @@ -18,7 +18,7 @@ USER=$NAME > GROUP=droonga > DAEMON=/usr/local/bin/$NAME > export DROONGA_BASE_DIR=/home/$NAME/droonga > -PIDFILE=/var/run/$NAME/$NAME.pid > +PIDFILE=$DROONGA_BASE_DIR/$NAME.pid > DAEMON_ARGS="--daemon --pid-file=$PIDFILE" > SCRIPTNAME=/etc/init.d/$NAME > > > Modified: install/debian/functions.sh (+0 -4) > =================================================================== > --- install/debian/functions.sh 2014-10-06 18:51:05 +0900 (0c65ba7) > +++ install/debian/functions.sh 2014-10-06 21:27:03 +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!"