diff options
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" |