diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-10-12 14:53:18 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-10-12 14:53:18 +0200 |
commit | 8af8276121d8ff36b8f2f9b85e7c17c0967d2f6b (patch) | |
tree | c46e534c83ccf35472243ed63e6c2365e4a64c49 /postgresql/bin/postgres-wrapper | |
parent | 7b91c886d9db1f81818e3b73b37fcb5d85734f59 (diff) | |
download | app.sh-misc-8af8276121d8ff36b8f2f9b85e7c17c0967d2f6b.tar.gz app.sh-misc-8af8276121d8ff36b8f2f9b85e7c17c0967d2f6b.tar.bz2 app.sh-misc-8af8276121d8ff36b8f2f9b85e7c17c0967d2f6b.tar.xz app.sh-misc-8af8276121d8ff36b8f2f9b85e7c17c0967d2f6b.zip |
o Error message when pg_ctl could not be found.
Diffstat (limited to 'postgresql/bin/postgres-wrapper')
-rw-r--r-- | postgresql/bin/postgres-wrapper | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/postgresql/bin/postgres-wrapper b/postgresql/bin/postgres-wrapper index 26b69c3..86be981 100644 --- a/postgresql/bin/postgres-wrapper +++ b/postgresql/bin/postgres-wrapper @@ -1,7 +1,20 @@ -#!/bin/bash -e +#!/bin/bash -PATH=$PATH:/opt/local/bin CONF=etc/postgresql.conf +PG_CTL=`which pg_ctl 2>/dev/null` + +set -e + +pwd +. $APPSH_BASEDIR/.app/lib/app-conf + +PG_CTL_OPTIONS="`get_conf $APPSH_BASEDIR $APPSH_NAME $APPSH_INSTANCE postgresql.pg_ctl_options`" + +if [ -z "$PG_CTL" ] +then + echo "Could not find pg_ctl. Is your env.PATH correctly set?". + exit 1 +fi if [ -z "$DATA" ] then @@ -44,16 +57,16 @@ LOG=`cd $x; pwd`/`basename $LOG` case "$APPSH_METHOD" in start) echo "Starting postgresql" - exec pg_ctl start \ + exec $PG_CTL start \ -D "$DATA" \ - -o "-c config_file=$CONF" \ + -o "$PG_CTL_OPTIONS -c config_file=$CONF" \ -l $LOG & ;; stop) echo "Stopping postgresql" - exec pg_ctl stop \ + exec $PG_CTL stop \ -D "$DATA" \ - -o "-c config_file=$CONF" + -o "$PG_CTL_OPTIONS -c config_file=$CONF" ;; *) echo "Unknown method: $APPSH_METHOD" |