diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2013-11-04 11:00:13 -0600 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-11-25 15:25:36 -0500 |
commit | 07a4cc7021a49149fabb332ec149a02c814e31a3 (patch) | |
tree | 226649d98fe1238f9951a1e509ddf176c0863b03 /meta-openstack/recipes-support | |
parent | 997c01f64397c56e54711d030efaf40d8547ea3a (diff) | |
download | meta-cloud-services-07a4cc7021a49149fabb332ec149a02c814e31a3.tar.gz |
postgresl: Fix startup script to use pg_ctl
The daemon-start-stop script will not actually wait synchronously for
postgress to start or stop. The postgresql package provides pg_ctl
for controlling the startup and clean shutdown of the database.
This patch converts to using pg_ctl for start and stop operations.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-support')
-rw-r--r-- | meta-openstack/recipes-support/postgresql/postgresql/postgresql | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta-openstack/recipes-support/postgresql/postgresql/postgresql b/meta-openstack/recipes-support/postgresql/postgresql/postgresql index 4df4536..a6b302b 100644 --- a/meta-openstack/recipes-support/postgresql/postgresql/postgresql +++ b/meta-openstack/recipes-support/postgresql/postgresql/postgresql | |||
@@ -22,7 +22,9 @@ start () | |||
22 | echo "already running." | 22 | echo "already running." |
23 | exit 0 | 23 | exit 0 |
24 | fi | 24 | fi |
25 | start-stop-daemon --start --quiet --chuid postgres --exec ${DAEMON} --background -- -D /etc/postgresql | 25 | touch /var/log/postgresql.log |
26 | chown postgres /var/log/postgresql.log | ||
27 | sudo -u postgres /usr/bin/pg_ctl start -w -D /etc/postgresql -s -l /var/log/postgresql.log | ||
26 | if [ $? -eq 0 ]; then | 28 | if [ $? -eq 0 ]; then |
27 | echo "done." | 29 | echo "done." |
28 | else | 30 | else |
@@ -37,7 +39,7 @@ stop () | |||
37 | echo "not running." | 39 | echo "not running." |
38 | exit 0 | 40 | exit 0 |
39 | fi | 41 | fi |
40 | start-stop-daemon --stop --quiet --chuid postgres --exec ${DAEMON} | 42 | sudo -u postgres /usr/bin/pg_ctl stop -w -D /etc/postgresql -m fast -s |
41 | if [ $? -eq 0 ]; then | 43 | if [ $? -eq 0 ]; then |
42 | echo "done." | 44 | echo "done." |
43 | else | 45 | else |