Commit ef883022 authored by Andrew Lee's avatar Andrew Lee

Refreshed obsapidelayed init script changes from upstream.

Signed-off-by: Andrew Lee's avatarAndrew Lee (李健秋) <ajqlee@debian.org>
parent 890c4c67
......@@ -60,45 +60,55 @@ case "$1" in
run_in_api script/delayed_job.api.rb --queue=releasetracking start -i 1000
run_in_api script/delayed_job.api.rb --queue=issuetracking start -i 1010
run_in_api script/delayed_job.api.rb --queue=mailers start -i 1020
# to be removed later. This is just for processing old jobs without default queue
run_in_api script/delayed_job.api.rb start -i 1030
echo -n "Starting OBS api clock daemon "
run_in_api $CLOCKWORKD --log-dir=log -l -c config/clock.rb -d $API_ROOT start
# searchd got started by clockd
;;
stop)
# The default queue used by ActiveJob (jobs scheduled with .perform_later)
run_in_api script/delayed_job.api.rb --queue=default start -i 1030
run_in_api script/delayed_job.api.rb --queue=project_log_rotate start -i 1040
run_in_api script/delayed_job.api.rb --queue=consistency_check start -i 1050
echo -n "Starting OBS searchd daemon "
FILE_SIZE=`stat -c '%s' /etc/obs/api/config/production.sphinx.conf`
if [ $FILE_SIZE -eq 0 ];then
run_in_api rails ts:rebuild
else
run_in_api rails ts:start
fi
echo -n "Starting OBS api clock daemon "
run_in_api $CLOCKWORKD --log-dir=log -l -c config/clock.rb start
;;
stop)
echo -n "Shutting down OBS api delayed job handler "
run_in_api script/delayed_job.api.rb --queue=quick stop -n $NUM
run_in_api script/delayed_job.api.rb --queue=releasetracking stop -i 1000
run_in_api script/delayed_job.api.rb --queue=issuetracking stop -i 1010
run_in_api script/delayed_job.api.rb --queue=mailers stop -i 1020
# to be removed later. This is just for processing old jobs without default queue
run_in_api script/delayed_job.api.rb stop -i 1030
echo -n "Shutting down OBS api clock daemon "
run_in_api script/delayed_job.api.rb --queue=default stop -i 1030
run_in_api script/delayed_job.api.rb --queue=project_log_rotate stop -i 1040
run_in_api script/delayed_job.api.rb --queue=consistency_check stop -i 1050
echo -n "Shutting down OBS api clock daemon "
run_in_api $CLOCKWORKD -l -c config/clock.rb stop
echo -n "Shutting down OBS searchd daemon "
run_in_api rake ts:stop
;;
run_in_api rails ts:stop
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
fi
;;
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
rc_status
;;
clean-restart)
$0 stop
rm -f $API_ROOT/db/sphinx/production/*
run_in_api rake ts:index
$0 start
;;
restart)
$0 stop
$0 start
;;
force-reload)
echo -n "Reload service OBS api delayed jobs "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment