Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2011-11-26 18:01:02 +0000
committerTom Lane2011-11-26 18:01:02 +0000
commit6c8768c3861d6690656b74676c44ffa63c0e4ef7 (patch)
tree9e2c39eb988e3bc663711bc6a17dd5cb5566ba06 /contrib/start-scripts/osx/PostgreSQL
parent4cdb41b54e432ee75e3c61e990b735b15fa66e81 (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 58e69bc784f..e4b56dfb3b4 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