|
From: <haw...@us...> - 2007-10-02 19:47:09
|
Revision: 169
http://pgsqlformac.svn.sourceforge.net/pgsqlformac/?rev=169&view=rev
Author: hawkmoon
Date: 2007-10-02 12:46:55 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
updated to address Leopard/Tiger compat. Dropped Panther Compat
Modified Paths:
--------------
trunk/Installers/PostgreSQL8/Resources/postflight
trunk/Installers/PostgreSQL8/Resources/preflight
Modified: trunk/Installers/PostgreSQL8/Resources/postflight
===================================================================
--- trunk/Installers/PostgreSQL8/Resources/postflight 2007-05-25 18:14:42 UTC (rev 168)
+++ trunk/Installers/PostgreSQL8/Resources/postflight 2007-10-02 19:46:55 UTC (rev 169)
@@ -3,56 +3,64 @@
# first let's make sure the the postgres user does
# not currently exist
-# set -e
+# Leopard/Tiger - this no longer works on Panther
-PG_GID=`/usr/bin/nifind -p //groups/postgres | grep "gid:.[0-9]" | sed 's/.*: //' | sed 's/ //'`
-
-# Group Doesn't Exist, create it
-if ! test $PG_GID; then
+echo Checking for Postgres group...
+PG_GID=`/usr/bin/dscl . read /groups/postgres PrimaryGroupID | grep "PrimaryGroupID:.[0-9]" | sed 's/.*: //' | sed 's/ //'`
+if test $PG_GID; then
+ echo ...found Postgres with GID of $PG_GID
+else
+ echo ...Postgres group not found
+
# loop through the '400's' until we find an available gid
X=401
until test $PG_GID; do
- TEST_GID=`/usr/bin/nidump -r /groups / | grep $X `
- if ! test "$TEST_GID"; then
+ TEST_GID=`/usr/bin/dscl . search /groups PrimaryGroupID $X | grep $X `
+
+ if test $TEST_GID; then
+ echo ...Group ID $X is not available
+ else
+ echo ...Group ID $X is available,
PG_GID=$X
fi
X=`expr $X + 1`
done
+
+ sudo /usr/bin/dscl . -create /groups/postgres PrimaryGroupID $PG_GID
+ echo ...Group postgres created with GID $PG_GID
- sudo /usr/bin/niutil -create / /groups/postgres
- sudo /usr/bin/niutil -createprop / /groups/postgres gid $PG_GID
fi
-# Display the GID for user information
-echo Postgres Group ID: $PG_GID
-
-# Now that the group exists, create the user
-
-PG_UID=`/usr/bin/nifind -p //users/postgres | grep "^uid:.[0-9]" | sed 's/.*: //' | sed 's/ //'`
+echo Checking for Postgres user...
+PG_UID=`/usr/bin/dscl . -read /users/postgres | grep "^UniqueID:.[0-9]" | sed 's/.*: //' | sed 's/ //'`
+if test $PG_UID; then
+ echo ...found user postgres with UID of $PG_UID
+else
+ echo ...user postgres not found
-# User Doesn't Exist, create it
-if ! test $PG_UID; then
- # loop through the '400's' until we find an available uid (start with the GID)
- X=$PG_GID
+ # loop through the '400's' until we find an available gid
+ X=401
until test $PG_UID; do
- TEST_UID=`/usr/bin/nidump -r /users / | grep "\"uid\" \= \( \"$X\" \);" `
- if ! test "$TEST_UID"; then
+ TEST_UID=`/usr/bin/dscl . -search /users UniqueID $X | grep $X `
+
+ if test $TEST_UID; then
+ echo ...Unique ID $X is not available
+ else
+ echo ...Unique ID $X is available,
PG_UID=$X
fi
X=`expr $X + 1`
done
-
- sudo /usr/bin/niutil -create / /users/postgres
- sudo /usr/bin/niutil -createprop / /users/postgres gid $PG_GID
- sudo /usr/bin/niutil -createprop / /users/postgres uid $PG_UID
- sudo /usr/bin/niutil -createprop / /users/postgres home "/Library/PostgreSQL8"
+
+ sudo /usr/bin/dscl . -create /users/postgres UniqueID $PG_UID
+ sudo /usr/bin/dscl . -append /users/postgres PrimaryGroupID $PG_GID
+ sudo /usr/bin/dscl . -append /users/postgres UserShell /usr/bin/false
+ sudo /usr/bin/dscl . -append /users/postgres RealName "PostgreSQL Server"
+ sudo /usr/bin/dscl . -append /users/postgres NFSHomeDirectory /var/empty
+
+ echo ...User postgres created with UID $PG_UID
fi
-
-sudo /usr/bin/niutil -resync /
-
-# Display the GID for user information
-echo Postgres User ID: $PG_UID
-
+
echo The Postgres user is configured, but you should set a
echo password on the newly created account. \(sudo passwd postgres\)
@@ -65,6 +73,7 @@
if test ! -f /Library/Logs/PostgreSQL8.log; then
sudo ln -s /Library/PostgreSQL8/log/PostgreSQL8.log /Library/Logs/PostgreSQL8.log
fi
+
sudo chown -R root:admin /Library/PostgreSQL8
sudo chown -R root:admin /Applications/PostgreSQL
sudo chown -R postgres:admin /Library/PostgreSQL8/log
@@ -74,6 +83,8 @@
sudo mkdir /Library/PostgreSQL8/data
sudo chown -R postgres:postgres /Library/PostgreSQL8/data
su -m postgres -c '/Library/PostgreSQL8/bin/initdb -D /Library/PostgreSQL8/data'
+else
+ sudo chown -R postgres:postgres /Library/PostgreSQL8/data
fi
echo Permissions have been altered to allow the automated startup
Modified: trunk/Installers/PostgreSQL8/Resources/preflight
===================================================================
--- trunk/Installers/PostgreSQL8/Resources/preflight 2007-05-25 18:14:42 UTC (rev 168)
+++ trunk/Installers/PostgreSQL8/Resources/preflight 2007-10-02 19:46:55 UTC (rev 169)
@@ -2,7 +2,7 @@
# check to see if PostgreSQL is running.
-x=`ps -auxwc | grep postgres |grep postmaster | awk -F" " '{print $2}'`
+x=`ps -auxwc | grep '^postgres' |grep 'postgres$' | awk -F" " '{print $2}'`
if /bin/test -n "$x"
then
# call shutdown...
@@ -11,7 +11,7 @@
su -m postgres -c '/Library/PostgreSQL8/bin/pg_ctl stop -D /Library/PostgreSQL8/data'
fi
- x=`ps -aux | grep postgres | grep postmaster | awk -F" " '{print $2}'`
+ x=`ps -auxwc | grep '^postgres' |grep 'postgres$' | awk -F" " '{print $2}'`
if /bin/test "$x"
then
set $x
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <haw...@us...> - 2007-10-10 18:09:59
|
Revision: 176
http://pgsqlformac.svn.sourceforge.net/pgsqlformac/?rev=176&view=rev
Author: hawkmoon
Date: 2007-10-10 11:09:59 -0700 (Wed, 10 Oct 2007)
Log Message:
-----------
removed background.tif to resolve type problems
Modified Paths:
--------------
trunk/Installers/PostgreSQL8/Resources/Readme.rtf
Removed Paths:
-------------
trunk/Installers/PostgreSQL8/Resources/background.tif
Modified: trunk/Installers/PostgreSQL8/Resources/Readme.rtf
===================================================================
--- trunk/Installers/PostgreSQL8/Resources/Readme.rtf 2007-10-10 04:03:55 UTC (rev 175)
+++ trunk/Installers/PostgreSQL8/Resources/Readme.rtf 2007-10-10 18:09:59 UTC (rev 176)
@@ -1,4 +1,4 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
+{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf440
{\fonttbl\f0\fnil\fcharset77 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red102\green102\blue102;}
\margl1440\margr1440\vieww9920\viewh9020\viewkind0
@@ -6,12 +6,12 @@
\f0\fs24 \cf0 This distribution contains code from several sources, and while the bulk of the projects are released under BSD style licenses, pgsqlODBC, the ODBC driver is a Gnu Public License project, and uses either the GPL of LGPL, so it is safe to build closed source applications that dynamically link against it. \
\
-The core of the PostgreSQL database engine is from http://www.postgresql.org, and is \cf2 Copyright \'a9 1996 \'d0 2005 PostgreSQL Global Development Group\cf0 . \
+The core of the PostgreSQL database engine is from http://www.postgresql.org, and is \cf2 Copyright \'a9 1996 \'d0 2007 PostgreSQL Global Development Group\cf0 . \
\
-The JDBC driver is from http://jdbc.postgresql.org/index.html and is also \cf2 Copyright \'a9 1996 \'d0 2005 PostgreSQL Global Development Group\cf0 . \
+The JDBC driver is from http://jdbc.postgresql.org/index.html and is also \cf2 Copyright \'a9 1996 \'d0 2007 PostgreSQL Global Development Group\cf0 . \
\
-The ODBC driver is from http://odbc.postgresql.org/ and is also \cf2 Copyright \'a9 1996 \'d0 2005 PostgreSQL Global Development Group\cf0 , with other credits to the original developers, and later updates and changes from Insight Systems.\
+The ODBC driver is from http://odbc.postgresql.org/ and is also \cf2 Copyright \'a9 1996 \'d0 2007 PostgreSQL Global Development Group\cf0 , with other credits to the original developers, and later updates and changes from Insight Systems.\
\
-The various graphical tools for Mac OS X are \cf2 Copyright \'a9 2004 \'d0 2005 Druware Software Designs\cf0 .\
+The various graphical tools for Mac OS X are \cf2 Copyright \'a9 2004 \'d0 2007 Druware Software Designs\cf0 .\
\
The StartupItem is slightly modified from the one that Marc Liyange created, along with his original efforts at getting PostgreSQL running on Mac OS X.}
\ No newline at end of file
Deleted: trunk/Installers/PostgreSQL8/Resources/background.tif
===================================================================
--- trunk/Installers/PostgreSQL8/Resources/background.tif 2007-10-10 04:03:55 UTC (rev 175)
+++ trunk/Installers/PostgreSQL8/Resources/background.tif 2007-10-10 18:09:59 UTC (rev 176)
@@ -1,1165 +0,0 @@
-MM |