Commit 44c6a402 authored by Lucas Kanashiro's avatar Lucas Kanashiro

debian/rake-tasks.sh: create a function to reload obsapi

parent 17b89037
......@@ -15,6 +15,19 @@ reload_apache()
fi
}
reload_obsapi()
{
systemctl "$1" obsapi-clockwork.service 3>/dev/null || true
systemctl "$1" obsapi-delayedjob-queue-consistency_check.service 3>/dev/null || true
systemctl "$1" obsapi-delayedjob-queue-default.service 3>/dev/null || true
systemctl "$1" obsapi-delayedjob-queue-issuetracking.service 3>/dev/null || true
systemctl "$1" obsapi-delayedjob-queue-mailers.service 3>/dev/null || true
systemctl "$1" obsapi-delayedjob-queue-project_log_rotate.service 3>/dev/null || true
systemctl "$1" obsapi-delayedjob-queue-quick.service 3>/dev/null || true
systemctl "$1" obsapi-delayedjob-queue-releasetracking.service 3>/dev/null || true
echo "obsapi reloaded."
}
case "$1" in
setup)
......@@ -51,18 +64,7 @@ case "$1" in
run_in_api clockworkd -l -c config/clock.rb stop || true
# Start up obsapi daemons
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d obsapi-clockwork.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-consistency_check.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-default.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-issuetracking.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-mailers.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-project_log_rotate.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-quick.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-releasetracking.service restart 3>/dev/null || true
echo "obsapi restarted."
fi
reload_obsapi start
# Test whether a2enmod is available (and thus also apache2ctl).
if [ -x /usr/sbin/a2enmod ]; then
......@@ -90,17 +92,7 @@ case "$1" in
echo 'Delayed::Job.destroy_all' | RAILS_ENV=production bundle exec rails console >> log/destroy_all_jobs.log
# Restart all daemons
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d obsapi-clockwork.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-consistency_check.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-default.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-issuetracking.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-mailers.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-project_log_rotate.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-quick.service restart 3>/dev/null || true
invoke-rc.d obsapi-delayedjob-queue-releasetracking.service restart 3>/dev/null || true
echo "obsapi restarted."
fi
reload_obsapi restart
# Restart Apache to really enable the module and load obs.conf
reload_apache restart
......
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