BUG #3879: OS X Start Script should not `cd /Users/postgres`

Started by David E. Wheelerover 18 years ago2 messagesbugs
Jump to latest
#1David E. Wheeler
david@kineticode.com

The following bug has been logged online:

Bug reference: 3879
Logged by: David Wheeler
Email address: david@kineticode.com
PostgreSQL version: 8.3RC1
Operating system: Mac OS X 10.5.1
Description: OS X Start Script should not `cd /Users/postgres`
Details:

The Mac OS X start script (contrib/start-scripts/osx/PostgreSQL) should not
have the recently-added lines `cd /Users/postgres` for the following
reasons:

* Not all systems use that username.
* Even those that use the "postgres" username may not have a home
directory.
* changing to the home directory appears to have no effect whatsoever.

Here is the patch:

--- contrib/start-scripts/osx/PostgreSQL.orig	2008-01-15 16:24:54.000000000
-0800
+++ contrib/start-scripts/osx/PostgreSQL	2008-01-15 16:25:11.000000000
-0800
@@ -84,7 +84,6 @@
 StartService () {
     if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
         ConsoleMessage "Starting PostgreSQL database server"
-        cd /Users/postgres
         if [ "${ROTATELOGS}" = "1" ]; then
             sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' 2>&1 |
${LOGUTIL} '${PGLOG}' ${ROTATESEC} &"
         else
@@ -95,7 +94,6 @@

StopService () {
ConsoleMessage "Stopping PostgreSQL database server"
- cd /Users/postgres
sudo -u $PGUSER $PGCTL stop -D "$PGDATA" -s -m fast
}

@@ -103,7 +101,6 @@
if [ "${POSTGRESQL:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Restarting PostgreSQL database server"
# should match StopService:
- cd /Users/postgres
sudo -u $PGUSER $PGCTL stop -D "$PGDATA" -s -m fast
# should match StartService:
if [ "${ROTATELOGS}" = "1" ]; then

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David E. Wheeler (#1)
Re: BUG #3879: OS X Start Script should not `cd /Users/postgres`

"David Wheeler" <david@kineticode.com> writes:

The Mac OS X start script (contrib/start-scripts/osx/PostgreSQL) should not
have the recently-added lines `cd /Users/postgres` for the following
reasons:

I agree. Removed, thanks for the report.

regards, tom lane