summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2007-05-30 18:10:38 +0000
committerBruce Momjian2007-05-30 18:10:38 +0000
commitc4da1aafd9e36609070e78bb6965d1e5777d0caf (patch)
tree27add2749400e7090fb04ee0762c59f71d9e662a
parente5f9061660b315bffe60eb27172ad15e51249d07 (diff)
Update /contrib OS/X startup files, and move to a separate OS/X
directory. Mark Cotner and David Fetter
-rwxr-xr-xcontrib/start-scripts/osx/PostgreSQL (renamed from contrib/start-scripts/PostgreSQL.darwin)13
-rw-r--r--contrib/start-scripts/osx/README3
-rw-r--r--contrib/start-scripts/osx/StartupParameters.plist (renamed from contrib/start-scripts/StartupParameters.plist.darwin)0
-rwxr-xr-xcontrib/start-scripts/osx/install.sh10
4 files changed, 21 insertions, 5 deletions
diff --git a/contrib/start-scripts/PostgreSQL.darwin b/contrib/start-scripts/osx/PostgreSQL
index 3e4b86a7f3..66c11093cf 100755
--- a/contrib/start-scripts/PostgreSQL.darwin
+++ b/contrib/start-scripts/osx/PostgreSQL
@@ -16,13 +16,13 @@
#
# Next, add this line to the /etc/hostconfig file:
#
-# POSTGRESQLSERVER=-YES-
+# POSTGRESQL=-YES-
#
# The startup bundle will now be ready to go. To prevent this script from
# starting PostgreSQL at system startup, simply change that line in
# /etc/hostconfig back to:
#
-# POSTGRESQLSERVER=-NO-
+# POSTGRESQL=-NO-
#
# For more information on Darwin/Mac OS X startup bundles, see this article:
#
@@ -66,7 +66,7 @@ ROTATESEC="604800"
################################################################################
# The path that is to be used for the script
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+PATH=/usr/local/pgsql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# What to use to start up the postmaster (we do NOT use pg_ctl for this,
# as it adds no value and can cause the postmaster to misrecognize a stale
@@ -82,8 +82,9 @@ LOGUTIL="/usr/sbin/rotatelogs"
. /etc/rc.common
StartService () {
- if [ "${POSTGRESQLSERVER:=-NO-}" = "-YES-" ]; then
+ 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}' | ${LOGUTIL} '${PGLOG}' ${ROTATESEC} &"
else
@@ -94,13 +95,15 @@ StartService () {
StopService () {
ConsoleMessage "Stopping PostgreSQL database server"
+ cd /Users/postgres
sudo -u $PGUSER $PGCTL stop -D "$PGDATA" -s -m fast
}
RestartService () {
- if [ "${POSTGRESQLSERVER:=-NO-}" = "-YES-" ]; then
+ 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
diff --git a/contrib/start-scripts/osx/README b/contrib/start-scripts/osx/README
new file mode 100644
index 0000000000..97e299f7da
--- /dev/null
+++ b/contrib/start-scripts/osx/README
@@ -0,0 +1,3 @@
+To install execute the following:
+
+sudo /bin/sh ./install.sh
diff --git a/contrib/start-scripts/StartupParameters.plist.darwin b/contrib/start-scripts/osx/StartupParameters.plist
index 6c788d0dda..6c788d0dda 100644
--- a/contrib/start-scripts/StartupParameters.plist.darwin
+++ b/contrib/start-scripts/osx/StartupParameters.plist
diff --git a/contrib/start-scripts/osx/install.sh b/contrib/start-scripts/osx/install.sh
new file mode 100755
index 0000000000..bbc5ee3926
--- /dev/null
+++ b/contrib/start-scripts/osx/install.sh
@@ -0,0 +1,10 @@
+sudo sh -c 'echo "POSTGRESQL=-YES-" >> /etc/hostconfig'
+sudo mkdir /Library/StartupItems/PostgreSQL
+sudo cp PostgreSQL /Library/StartupItems/PostgreSQL
+sudo cp StartupParameters.plist /Library/StartupItems/PostgreSQL
+if [ -e /Library/StartupItems/PostgreSQL/PostgreSQL ]
+then
+ echo "Startup Item Installed Successfully . . . "
+ echo "Starting PostgreSQL Server . . . "
+ SystemStarter restart PostgreSQL
+fi