summaryrefslogtreecommitdiffstats
path: root/database/postgresql/init.d/postgresql
diff options
context:
space:
mode:
Diffstat (limited to 'database/postgresql/init.d/postgresql')
-rw-r--r--database/postgresql/init.d/postgresql27
1 files changed, 11 insertions, 16 deletions
diff --git a/database/postgresql/init.d/postgresql b/database/postgresql/init.d/postgresql
index 8d9e94221e..f9e9393e95 100644
--- a/database/postgresql/init.d/postgresql
+++ b/database/postgresql/init.d/postgresql
@@ -11,13 +11,13 @@ start()
{
echo "Starting postmaster..."
cd "$DBPATH" &&
- if [[ ! -z "$PORT" ]]; then
+ if [[ ! -z "$PORT" ]]; then
PGPORT="-p $PORT"
- fi &&
- if [[ ! "$LOGFILE" = 'syslog' ]]; then
+ fi &&
+ if [[ $LOGFILE ]]; then
PGLOG="-l $LOGFILE"
- fi &&
- su -s /bin/sh -m -c "pg_ctl start -D '$DBPATH' $PGPORT $PGLOG" -l "$USER"
+ fi &&
+ su $USER -s /bin/sh -c "pg_ctl start -D $DBPATH $PGLOG -o '$PGPORT'"
evaluate_retval
}
@@ -25,19 +25,14 @@ stop()
{
echo "Stopping postmaster..."
cd "$DBPATH" &&
- su -s /bin/sh -c "pg_ctl stop -D '$DBPATH' -m fast" -l "$USER"
+ su $USER -s /bin/sh -c "pg_ctl stop -D $DBPATH -m fast"
evaluate_retval
}
-restart()
+reload()
{
- echo "Restarting postmaster..."
- stop
- start
-# cd "$DBPATH" &&
-# if [[ "$LOGFILE" = 'syslog' ]]; then
-# su -l "$USER" -s /bin/sh -c "pg_ctl restart -D '$DBPATH'"
-# else
-# su -l "$USER" -s /bin/sh -c "pg_ctl restart -D '$DBPATH' -l '$LOGFILE'"
-# fi
+ echo "Reloading postmaster configuration..."
+ cd "$DBPATH" &&
+ su $USER -s /bin/sh -c "pg_ctl reload -D $DBPATH"
+ evaluate_retval
}