summaryrefslogtreecommitdiff
path: root/contrib/start-scripts/osx/PostgreSQL
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-11-26 13:01:02 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-11-26 13:01:32 -0500
commit87b0dcf490ffe2930940488b89ff94c62dd7153b (patch)
tree9b7444415a30bf095ec03be6d9c84d5590134c0d /contrib/start-scripts/osx/PostgreSQL
parentd1644d9c31102e12560c864fae10bb7ab1826adb (diff)
Fix overly-aggressive and inconsistent quoting in OS X start script.
Sidar Lopez, per bug #6310, with some additional improvements by me. Back-patch to 9.0, where the issue was introduced.
Diffstat (limited to 'contrib/start-scripts/osx/PostgreSQL')
-rwxr-xr-xcontrib/start-scripts/osx/PostgreSQL12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/start-scripts/osx/PostgreSQL b/contrib/start-scripts/osx/PostgreSQL
index 65150d0fd56..81f6c54de08 100755
--- a/contrib/start-scripts/osx/PostgreSQL
+++ b/contrib/start-scripts/osx/PostgreSQL
@@ -85,28 +85,28 @@ StartService () {
if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting PostgreSQL database server"
if [ "${ROTATELOGS}" = "1" ]; then
- sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" 2>&1 | ${LOGUTIL} '${PGLOG}' ${ROTATESEC} &
+ sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" 2>&1 | ${LOGUTIL} "${PGLOG}" ${ROTATESEC} &
else
- sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" >>$PGLOG 2>&1
+ sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" >>"$PGLOG" 2>&1
fi
fi
}
StopService () {
ConsoleMessage "Stopping PostgreSQL database server"
- sudo -u $PGUSER $PGCTL stop -D "$PGDATA" -s -m fast
+ sudo -u $PGUSER sh -c "$PGCTL stop -D '${PGDATA}' -s -m fast"
}
RestartService () {
if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Restarting PostgreSQL database server"
# should match StopService:
- sudo -u $PGUSER $PGCTL stop -D "$PGDATA" -s -m fast
+ sudo -u $PGUSER sh -c "$PGCTL stop -D '${PGDATA}' -s -m fast"
# should match StartService:
if [ "${ROTATELOGS}" = "1" ]; then
- sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" 2>&1 | ${LOGUTIL} '${PGLOG}' ${ROTATESEC} &
+ sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" 2>&1 | ${LOGUTIL} "${PGLOG}" ${ROTATESEC} &
else
- sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" >>$PGLOG 2>&1
+ sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' &" >>"$PGLOG" 2>&1
fi
else
StopService