[GRASSLIST:5995] Re: Postgress and GRASS CD

david mahoney mahoneyd at unbc.ca
Wed Apr 9 18:27:42 EDT 2003


You need a postgres user and a postgres group on your system. For some 
reason the MySQL install (via Fink) creates the necessary user and 
group for itself, but Postgres doesn't.

If you have Mac OS X 10.2 or later, you can just add a line to your 
/etc/group file.
postgres:*:71:

The group number 71 works on my system, but if there's already a 71 in 
the group file, choose an unused number.
To add the user postgres, run sudo vipw. You get to edit the passwd 
file with vi.
Add something like
postgres:*:71:71:Postgresql Server:/nohome:/noshell

Again, if 71 is taken, use something else.
If you can't figure out vi, or don't have Jaguar, you're stuck with 
adding the user and group in NetInfo (/Applications/Utilities/NetInfo 
Manager)

Good Luck

Dave

On Tuesday, April 8, 2003, at 04:01 PM, John Chesnut wrote:

>
> Can some one who has experience getting  Postgres interoperating with 
> Grass on Mac OSX please post step by step instructions.
>
> The initdb command will create a "data" directory, but the postgres 
> server fails on startup. The initdb command requires su as the 
> "postgres" user
> 	su postgres
> 	/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
> complete successfully.
>
> Several issues are apparent
>
> 1. Postmaster does not successufully start using the terminal command 
> postmaster (eg.
>
> 	 sudo -u postgres /usr/local/pgsql/bin/postmaster -i -D 
> /usr/local/pgsql/data
>
> this reports the error
> 	FATAL:  no such group 'pgsql'
> 	/usr/local/pgsql/bin/postmaster: cannot create UNIX stream port
> my interpretation:  some parts of postmaster need write permission 
> with group pgsql which is not created by MacOSX
>
> 2, attempting to open the postmaster with the command
> 	 sudo -u pgsql /usr/local/pgsql/bin/postmaster -i -D 
> /usr/local/pgsql/data
> yield the error
> 	FATAL 1:  cannot open /usr/local/pgsql/data/PG_VERSION: Permission 
> denied
> my interpretation:  requires read permission of user "postgres" which 
> is lacking for user pgsql
>
> (I created the alternative user pgsql in an attempt to start 
> postmaster)
>
> 3. attempting to start postmaster using the pg_ctl script as either 
> user postgres or pgsql yields a similar error.
>
> 	sudo -u root sudo -u pgsql /usr/local/pgsql/bin/pg_ctl start -D 
> /usr/local/pgsql/data
> this returns a message
> 	postmaster successfully started
> 	FATAL 1:  cannot open /usr/local/pgsql/data/PG_VERSION: Permission 
> denied
> same error as 2.
>
> Evidently getting the postmaster/postgres server running need 
> alterations of permissions and groups, but no documentation is 
> available that explains how to create a "pgsql" group and associate it 
> with a "postgres" user.
>
> Changing the /usr/local/pgsql/data directory permissions to 777 or 766 
> yields an fatal error that permissions are incorrect: so simply 
> expanding permissions doesn't work. The error reported is:
> FATAL 1:  data directory /usr/local/pgsql/data has group or world 
> access; permissions should be u=rwx (0700)
>
> trying to create a user from within postgres as in
> 	sudo -u postgres /usr/local/pgsql/bin/createuser jchesnut
> fails because
> 	psql: could not connect to server: No such file or directory
>       		 Is the server running locally and accepting
>        		connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> my interpretation:  postmaster / postgres must be running before the 
> createuser command can be issued.  postgres wont run because of the 
> fatal errors listed above.
>
>
> Please help, if you know how to get postgres running under OSX
>
>
>




More information about the grass-user mailing list