From 07a4cc7021a49149fabb332ec149a02c814e31a3 Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Mon, 4 Nov 2013 11:00:13 -0600 Subject: 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 --- meta-openstack/recipes-support/postgresql/postgresql/postgresql | 6 ++++-- 1 file 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 () echo "already running." exit 0 fi - start-stop-daemon --start --quiet --chuid postgres --exec ${DAEMON} --background -- -D /etc/postgresql + touch /var/log/postgresql.log + chown postgres /var/log/postgresql.log + sudo -u postgres /usr/bin/pg_ctl start -w -D /etc/postgresql -s -l /var/log/postgresql.log if [ $? -eq 0 ]; then echo "done." else @@ -37,7 +39,7 @@ stop () echo "not running." exit 0 fi - start-stop-daemon --stop --quiet --chuid postgres --exec ${DAEMON} + sudo -u postgres /usr/bin/pg_ctl stop -w -D /etc/postgresql -m fast -s if [ $? -eq 0 ]; then echo "done." else -- cgit v1.2.3-54-g00ecf