1616#
1717# Next, add this line to the /etc/hostconfig file:
1818#
19- # POSTGRESQLSERVER =-YES-
19+ # POSTGRESQL =-YES-
2020#
2121# The startup bundle will now be ready to go. To prevent this script from
2222# starting PostgreSQL at system startup, simply change that line in
2323# /etc/hostconfig back to:
2424#
25- # POSTGRESQLSERVER =-NO-
25+ # POSTGRESQL =-NO-
2626#
2727# For more information on Darwin/Mac OS X startup bundles, see this article:
2828#
@@ -66,7 +66,7 @@ ROTATESEC="604800"
6666# ###############################################################################
6767
6868# The path that is to be used for the script
69- PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
69+ PATH=/usr/local/pgsql/bin:/usr/local/ sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
7070
7171# What to use to start up the postmaster (we do NOT use pg_ctl for this,
7272# as it adds no value and can cause the postmaster to misrecognize a stale
@@ -82,8 +82,9 @@ LOGUTIL="/usr/sbin/rotatelogs"
8282. /etc/rc.common
8383
8484StartService () {
85- if [ " ${POSTGRESQLSERVER := -NO-} " = " -YES-" ]; then
85+ if [ " ${POSTGRESQL := -NO-} " = " -YES-" ]; then
8686 ConsoleMessage " Starting PostgreSQL database server"
87+ cd /Users/postgres
8788 if [ " ${ROTATELOGS} " = " 1" ]; then
8889 sudo -u $PGUSER sh -c " ${DAEMON} -D '${PGDATA} ' | ${LOGUTIL} '${PGLOG} ' ${ROTATESEC} &"
8990 else
@@ -94,13 +95,15 @@ StartService () {
9495
9596StopService () {
9697 ConsoleMessage " Stopping PostgreSQL database server"
98+ cd /Users/postgres
9799 sudo -u $PGUSER $PGCTL stop -D " $PGDATA " -s -m fast
98100}
99101
100102RestartService () {
101- if [ " ${POSTGRESQLSERVER := -NO-} " = " -YES-" ]; then
103+ if [ " ${POSTGRESQL := -NO-} " = " -YES-" ]; then
102104 ConsoleMessage " Restarting PostgreSQL database server"
103105 # should match StopService:
106+ cd /Users/postgres
104107 sudo -u $PGUSER $PGCTL stop -D " $PGDATA " -s -m fast
105108 # should match StartService:
106109 if [ " ${ROTATELOGS} " = " 1" ]; then
0 commit comments