Commit 17b89037 authored by Lucas Kanashiro's avatar Lucas Kanashiro

debian/rake-tasks.sh: stop all running processes from the old installation

Since we are moving from obsapidelayed to multiple systemd unit files,
after the upgrade some processes related to delayed_jobs and clockwork
might keep running. The setup task was modified to stop any of these
processes if they exist.
parent 9d149e5f
......@@ -21,8 +21,9 @@ open-build-service (2.9.4-3) UNRELEASED; urgency=medium
* debian/rake-tasks.sh: update migration task to restart all OBS related
services.
* debian/README.Debian: add instructions on how to upgrade an exitent instance
* debian/rake-tasks.sh: stop all running processes from the old installation
-- Lucas Kanashiro <kanashiro@debian.org> Tue, 09 Apr 2019 15:36:09 -0300
-- Lucas Kanashiro <kanashiro@debian.org> Fri, 12 Apr 2019 14:55:15 -0300
open-build-service (2.9.4-2) unstable; urgency=medium
......
......@@ -45,6 +45,11 @@ case "$1" in
run_in_api rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets
run_in_api rake ts:index RAILS_ENV=production || true
# Stop delayed jobs and queues that might be running based on the old codebase.
# This is a workaround to migrate from obsapidelayed init script to multiple systemd unit files.
run_in_api script/delayed_job.api.rb stop RAILS_ENV=production || true
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
......@@ -81,6 +86,9 @@ case "$1" in
cd /usr/share/obs/api
RAILS_ENV=production bundle exec rake db:migrate:with_data >> log/db_migrate.log
# Destroy any existent delayed job based on the old codebase
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
......
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