msg_starting PostgreSQL
busy
PGSQL_CMDLINE="$([ -n "$POSTGRES_DATA_DIR" ] && echo "-D $POSTGRES_DATA_DIR") \
- $([ "$POSTGRES_QUIET". = yes. ] && echo '-s -o -S') \
- $([ "$POSTGRES_DISABLE_FSYNC". = yes. ] && echo '-o -F')";
- su postgres -c "/usr/bin/pg_ctl start $PGSQL_CMDLINE -l $POSTGRES_LOG 2>&1 >/dev/null"
+ $([ "$POSTGRES_QUIET". = yes. ] && echo '-s')";
+ POSTMASTER_OPTIONS=" \
+ $([ "$POSTGRES_QUIET". = yes. ] && echo '-S') \
+ $([ "$POSTGRES_DISABLE_FSYNC". = yes. ] && echo '-F') \
+ $([ "$ALLOW_TCP_CONNECTIONS". = yes. ] && echo '-i')";
+
+ su postgres -c "\
+ $(echo "/usr/bin/pg_ctl start $PGSQL_CMDLINE -l $POSTGRES_LOG") \
+ $([ "$POSTMASTER_OPTIONS". != . ] && echo "-o '$POSTMASTER_OPTIONS'") \
+ $(echo "2>&1 >/dev/null")";
+
out=`status postmaster`
if [ $? -eq 0 ]; then
deltext; ok
touch /var/lock/subsys/postgresql
;;
stop)
+
if [ ! -f /var/lock/subsys/postgresql ]; then
msg_Not_Running PostgreSQL
exit 0
fi
msg_reloading postgreSQL
busy
+
PGSQL_CMDLINE="$([ -n "$POSTGRES_DATA_DIR" ] && echo "-D $POSTGRES_DATA_DIR") \
- $([ "$POSTGRES_QUIET". = yes. ] && echo '-s -o -S') \
- $([ "$POSTGRES_DISABLE_FSYNC". = yes. ] && echo '-o -F')";
- su postgres -c "/usr/bin/pg_ctl restart $PGSQL_CMDLINE -m fast 2>&1 >/dev/null"
+ $([ "$POSTGRES_QUIET". = yes. ] && echo '-s')";
+ POSTMASTER_OPTIONS=" \
+ $([ "$POSTGRES_QUIET". = yes. ] && echo '-S') \
+ $([ "$POSTGRES_DISABLE_FSYNC". = yes. ] && echo '-F') \
+ $([ "$ALLOW_TCP_CONNECTIONS". = yes. ] && echo '-i')";
+
+ su postgres -c "\
+ $(echo "/usr/bin/pg_ctl restart $PGSQL_CMDLINE -l $POSTGRES_LOG") \
+ $([ "$POSTMASTER_OPTIONS". != . ] && echo "-o '$POSTMASTER_OPTIONS'") \
+ $(echo "2>&1 >/dev/null")";
+
out=`status postmaster`
if [ $? -eq 0 ]; then
deltext; ok