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
1=== modified file 'hooks/config-changed'
2--- hooks/config-changed 2015-07-03 20:05:12 +0000
3+++ hooks/config-changed 2016-09-01 17:17:11 +0000
4@@ -39,7 +39,7 @@
5 #---------- postgresql
6
7 # if not running from a relation, while postgresql is still enabled
8-if [[ -z ${pg_name} ]] && $(pgrep -f postgres > /dev/null); then
9+if [[ -z ${db_name} ]] && $(pgrep -f postgres > /dev/null); then
10 juju-log "Setting up local DB..."
11
12 export t_db_name=${db_name}
13
14=== modified file 'hooks/db-relation-departed'
15--- hooks/db-relation-departed 2014-12-16 17:01:34 +0000
16+++ hooks/db-relation-departed 2016-09-01 17:17:11 +0000
17@@ -2,3 +2,4 @@
18
19 service postgresql start
20 update-rc.d postgresql defaults
21+echo auto > /etc/postgresql/9.3/main/start.conf
22
23=== modified file 'hooks/db-relation-joined'
24--- hooks/db-relation-joined 2015-03-06 22:11:30 +0000
25+++ hooks/db-relation-joined 2016-09-01 17:17:11 +0000
26@@ -30,6 +30,7 @@
27 # disables local one
28 service postgresql stop
29 update-rc.d -f postgresql remove
30+echo disabled > /etc/postgresql/9.3/main/start.conf
31
32 juju-log "Saving remote DB configuration in ${db_config}"
33 cheetah fill --env --stdout templates/capomastro_db_settings.tmpl > ${db_config}

Subscribers

People subscribed via source and target branches