|
From: <haw...@us...> - 2008-11-06 17:13:07
|
Revision: 211
http://pgsqlformac.svn.sourceforge.net/pgsqlformac/?rev=211&view=rev
Author: hawkmoon
Date: 2008-11-06 17:12:59 +0000 (Thu, 06 Nov 2008)
Log Message:
-----------
Refactored DATA_PATH and LOG_FILE out to variables to make them easier to maintain and adjust from the GUI Preference Pane and associated tools.
Modified Paths:
--------------
trunk/StartupItem/PostgreSQL/PostgreSQL
Modified: trunk/StartupItem/PostgreSQL/PostgreSQL
===================================================================
--- trunk/StartupItem/PostgreSQL/PostgreSQL 2008-10-30 18:20:38 UTC (rev 210)
+++ trunk/StartupItem/PostgreSQL/PostgreSQL 2008-11-06 17:12:59 UTC (rev 211)
@@ -55,6 +55,10 @@
# The PostgreSQL BSD-style license applies to this file
#
+# set the data path (this will be altered by the GUI configuration tools)
+DATA_PATH="/Library/PostgreSQL8/data"
+LOG_FILE="/Library/PostgreSQL8/log/PostgreSQL8.log"
+
StartService ()
{
shouldStartPostgres="-NO-"
@@ -69,17 +73,18 @@
if [ "$shouldStartPostgres" = "-YES-" ]; then
ConsoleMessage "Starting PostgreSQL database server"
- su -m postgres -c '/Library/PostgreSQL8/bin/pg_ctl start -D /Library/PostgreSQL8/data -l /Library/PostgreSQL8/log/PostgreSQL8.log -o -i'
+ su -m postgres -c "/Library/PostgreSQL8/bin/pg_ctl start -D $DATA_PATH -l $LOG_FILE -o -i"
fi
}
StopService()
{
-
ConsoleMessage "Stopping PostgreSQL database services"
- su -m postgres -c '/Library/PostgreSQL8/bin/pg_ctl stop -D /Library/PostgreSQL8/data'
- x=`ps -auxwc | grep '^postgres' |grep 'postgres$' | awk -F" " '{print $2}'`
+ su -m postgres -c "/Library/PostgreSQL8/bin/pg_ctl stop -D $DATA_PATH"
+
+ sleep 1
+ x=`ps auxwc | grep '^postgres' |grep 'postgres$' | awk -F" " '{print $2}'`
if /bin/test "$x"
then
set $x
@@ -91,11 +96,12 @@
RestartService ()
{
StopService
+ sleep 1
StartService
}
+
overrideEnvironment='-NO-'
-
for f in "$@"
do
if [ "$f" = "MANUAL" ]; then
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|