Merge lp:~caio1982/capomastro/stoppgsqlforrealz into lp:~ubuntuone-hackers/capomastro/charm

Proposed by Caio Begotti
Status: Merged
Approved by: Caio Begotti
Approved revision: 74
Merged at revision: 73
Proposed branch: lp:~caio1982/capomastro/stoppgsqlforrealz
Merge into: lp:~ubuntuone-hackers/capomastro/charm
Diff against target: 33 lines (+3/-1)
3 files modified
hooks/config-changed (+1/-1)
hooks/db-relation-departed (+1/-0)
hooks/db-relation-joined (+1/-0)
To merge this branch: bzr merge lp:~caio1982/capomastro/stoppgsqlforrealz
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+304681@code.launchpad.net

Commit message

This should hopefully help Capomastro not to loose its mind again if Postgresql is upgraded from the Debian package, thus being brought up suddenly and confusing the charm checks for DB relation. This has caused a bunch of HTTP 500s today. Axino found out the culprit.

Description of the change

This should hopefully help Capomastro not to loose its mind again if Postgresql is upgraded from the Debian package, thus being brought up suddenly and confusing the charm checks for DB relation. This has caused a bunch of HTTP 500s today. Axino found out the culprit.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks OK to me, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/config-changed'
--- hooks/config-changed 2015-07-03 20:05:12 +0000
+++ hooks/config-changed 2016-09-01 17:17:11 +0000
@@ -39,7 +39,7 @@
39#---------- postgresql39#---------- postgresql
4040
41# if not running from a relation, while postgresql is still enabled41# if not running from a relation, while postgresql is still enabled
42if [[ -z ${pg_name} ]] && $(pgrep -f postgres > /dev/null); then42if [[ -z ${db_name} ]] && $(pgrep -f postgres > /dev/null); then
43 juju-log "Setting up local DB..."43 juju-log "Setting up local DB..."
4444
45 export t_db_name=${db_name}45 export t_db_name=${db_name}
4646
=== modified file 'hooks/db-relation-departed'
--- hooks/db-relation-departed 2014-12-16 17:01:34 +0000
+++ hooks/db-relation-departed 2016-09-01 17:17:11 +0000
@@ -2,3 +2,4 @@
22
3service postgresql start3service postgresql start
4update-rc.d postgresql defaults4update-rc.d postgresql defaults
5echo auto > /etc/postgresql/9.3/main/start.conf
56
=== modified file 'hooks/db-relation-joined'
--- hooks/db-relation-joined 2015-03-06 22:11:30 +0000
+++ hooks/db-relation-joined 2016-09-01 17:17:11 +0000
@@ -30,6 +30,7 @@
30# disables local one30# disables local one
31service postgresql stop31service postgresql stop
32update-rc.d -f postgresql remove32update-rc.d -f postgresql remove
33echo disabled > /etc/postgresql/9.3/main/start.conf
3334
34juju-log "Saving remote DB configuration in ${db_config}"35juju-log "Saving remote DB configuration in ${db_config}"
35cheetah fill --env --stdout templates/capomastro_db_settings.tmpl > ${db_config}36cheetah fill --env --stdout templates/capomastro_db_settings.tmpl > ${db_config}

Subscribers

People subscribed via source and target branches