Manually stopping postgres does not have an effect on the unit:
$ juju run --machine 1 "sudo service postgresql stop" * Stopping PostgreSQL 9.3 database server ...done. $ juju run --machine 1 "ps aux | grep post" root 864 0.0 0.0 294444 10624 ? Ssl 10:19 0:00 /var/lib/juju/tools/unit-postgresql-0/jujud unit --data-dir /var/lib/juju --unit-name postgresql/0 --debug $ juju run --machine 1 "cat /var/log/postgresql/postgresql-9.3-main.log" 2014-08-21 16:19:57 UTC [3337]: [1-1] db=,user= LOG: database system was shut down at 2014-08-21 16:19:55 UTC 2014-08-21 16:19:57 UTC [3336]: [1-1] db=,user= LOG: database system is ready to accept connections 2014-08-21 16:19:57 UTC [3341]: [1-1] db=,user= LOG: autovacuum launcher started 2014-08-21 16:19:58 UTC [3343]: [1-1] db=[unknown],user=[unknown] LOG: incomplete startup packet 2014-08-21 16:34:00 UTC [3336]: [2-1] db=,user= LOG: received fast shutdown request 2014-08-21 16:34:00 UTC [3336]: [3-1] db=,user= LOG: aborting any active transactions 2014-08-21 16:34:00 UTC [3341]: [2-1] db=,user= LOG: autovacuum launcher shutting down 2014-08-21 16:34:00 UTC [3338]: [1-1] db=,user= LOG: shutting down 2014-08-21 16:34:00 UTC [3338]: [2-1] db=,user= LOG: database system is shut down $ juju status environment: local machines: "0": agent-state: started agent-version: 1.21-alpha1.1 dns-name: localhost instance-id: localhost series: trusty state-server-member-status: has-vote "1": agent-state: started agent-version: 1.21-alpha1.1 dns-name: 10.0.3.45 instance-id: esnow-local-machine-1 series: trusty hardware: arch=amd64 "2": agent-state: started agent-version: 1.21-alpha1.1 dns-name: 10.0.3.245 instance-id: esnow-local-machine-2 series: precise hardware: arch=amd64 services: postgresql: charm: cs:trusty/postgresql-3 exposed: false life: dying units: postgresql/0: agent-state: error agent-state-info: 'hook failed: "install"' agent-version: 1.21-alpha1.1 life: dying machine: "1" open-ports: - 5432/tcp public-address: 10.0.3.45 reviewboard: charm: cs:precise/reviewboard-1 exposed: true units: reviewboard/0: agent-state: started agent-version: 1.21-alpha1.1 machine: "2" open-ports: - 80/tcp public-address: 10.0.3.245
Manually stopping postgres does not have an effect on the unit:
$ juju run --machine 1 "sudo service postgresql stop" juju/tools/ unit-postgresql -0/jujud unit --data-dir /var/lib/juju --unit-name postgresql/0 --debug postgresql/ postgresql- 9.3-main. log" ,user=[ unknown] LOG: incomplete startup packet server- member- status: has-vote machine- 1 machine- 2 postgresql- 3
agent- state: error
agent- state-info: 'hook failed: "install"'
agent- version: 1.21-alpha1.1
public- address: 10.0.3.45 reviewboard- 1 rd/0:
agent- state: started
agent- version: 1.21-alpha1.1
public- address: 10.0.3.245
* Stopping PostgreSQL 9.3 database server
...done.
$ juju run --machine 1 "ps aux | grep post"
root 864 0.0 0.0 294444 10624 ? Ssl 10:19 0:00 /var/lib/
$ juju run --machine 1 "cat /var/log/
2014-08-21 16:19:57 UTC [3337]: [1-1] db=,user= LOG: database system was shut down at 2014-08-21 16:19:55 UTC
2014-08-21 16:19:57 UTC [3336]: [1-1] db=,user= LOG: database system is ready to accept connections
2014-08-21 16:19:57 UTC [3341]: [1-1] db=,user= LOG: autovacuum launcher started
2014-08-21 16:19:58 UTC [3343]: [1-1] db=[unknown]
2014-08-21 16:34:00 UTC [3336]: [2-1] db=,user= LOG: received fast shutdown request
2014-08-21 16:34:00 UTC [3336]: [3-1] db=,user= LOG: aborting any active transactions
2014-08-21 16:34:00 UTC [3341]: [2-1] db=,user= LOG: autovacuum launcher shutting down
2014-08-21 16:34:00 UTC [3338]: [1-1] db=,user= LOG: shutting down
2014-08-21 16:34:00 UTC [3338]: [2-1] db=,user= LOG: database system is shut down
$ juju status
environment: local
machines:
"0":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: localhost
instance-id: localhost
series: trusty
state-
"1":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: 10.0.3.45
instance-id: esnow-local-
series: trusty
hardware: arch=amd64
"2":
agent-state: started
agent-version: 1.21-alpha1.1
dns-name: 10.0.3.245
instance-id: esnow-local-
series: precise
hardware: arch=amd64
services:
postgresql:
charm: cs:trusty/
exposed: false
life: dying
units:
postgresql/0:
life: dying
machine: "1"
open-ports:
- 5432/tcp
reviewboard:
charm: cs:precise/
exposed: true
units:
reviewboa
machine: "2"
open-ports:
- 80/tcp