Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
refs #11648 - ensure postgresql is started
Browse files Browse the repository at this point in the history
  • Loading branch information
stbenjam committed Sep 2, 2015
1 parent b837326 commit 8d8b715
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions hooks/pre/30-upgrade.rb
@@ -1,17 +1,13 @@
def stop_services
Kafo::Helpers.execute('katello-service stop --exclude mongod')
Kafo::Helpers.execute('katello-service stop --exclude mongod,postgresql')
end

def start_mongo
status = Kafo::Helpers.execute('service-wait mongod status')
Kafo::Helpers.execute('service-wait mongod start') unless status
Kafo::Helpers.execute('service-wait mongod status')
def start_databases
Kafo::Helpers.execute('katello-service start --only mongod,postgresql')
end

def start_httpd
status = Kafo::Helpers.execute('service-wait httpd status')
Kafo::Helpers.execute('service-wait httpd start') unless status
Kafo::Helpers.execute('service-wait httpd status')
Kafo::Helpers.execute('katello-service start --only httpd')
end

def migrate_candlepin
Expand Down Expand Up @@ -62,9 +58,9 @@ def fail_and_exit(message)
if app_value(:upgrade)
Kafo::Helpers.log_and_say :info, 'Upgrading...'
upgrade_step :stop_services
upgrade_step :start_databases

if Kafo::Helpers.module_enabled?(@kafo, 'katello') || @kafo.param('capsule', 'pulp').value
upgrade_step :start_mongo
upgrade_step :migrate_pulp
upgrade_step :start_httpd
end
Expand Down

0 comments on commit 8d8b715

Please sign in to comment.