Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8FEA69FBF03 for ; Wed, 20 Jun 2007 21:58:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 30343-06 for ; Wed, 20 Jun 2007 21:58:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from alias3.ihug.co.nz (alias3.ihug.co.nz [203.96.222.13]) by postgresql.org (Postfix) with ESMTP id 43A589FBEC3 for ; Wed, 20 Jun 2007 21:58:26 -0300 (ADT) Received: from ironport3.ihug.co.nz [203.109.254.23] by alias3.ihug.co.nz with esmtp (Exim 3.36 #1 (Debian)) id 1I1B0C-00084j-00; Thu, 21 Jun 2007 12:58:24 +1200 Received: from grunt7.ihug.co.nz (HELO ihug.co.nz) ([203.109.254.47]) by ironport3.ihug.co.nz with SMTP; 21 Jun 2007 12:58:22 +1200 X-Ironport-Seen: Yes From: Joe Barwell Reply-to: Joe Barwell To: Subject: Re: initdb problem X-Mailer: Quality Web Email v3.1m, http://netwinsite.com/refw.htm X-Originating-IP: 222.154.165.88 Date: Thu, 21 Jun 2007 12:58:22 +1200 Message-id: <4679cd2e.22.42fc.1545812171@ihug.co.nz> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.329 tagged_above=0 required=5 tests=AWL=0.328, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/212 X-Sequence-Number: 25880 Hello People, My thanks to the several people who gave suggestions for how to solve my initdb problem. 1. "Phillip Smith" suggested the problems stemmed from: the 'postgres' user not having a correct shell login setup. It looks like the home directory is set to /dev/null which would explain all the "not a directory" errors. You'll need to edit the postgers user to have a proper login shell (/bin/bash maybe?). I had previously been told something along these lines, and so had already given postgres a shell of /bin/bash (using NetInfo Manager). It is only since making that change that I have been able to login as postgres at all. I note, however, that postgres' home is still set to /dev/null, and would be interested in trying to re-set that to something possibly more useful, except I don't know what to use--any suggestions, anyone? 2. "'James Herbers'" suggested: as root you have to chown /Library/postgreSQL8/ -R (this is what you do in Linux). As shown below, the binary installer for pg 8.2.4 seemed to already set that up correctly: Acorn:/Library/PostgreSQL8 root# ls -l total 0 drwxr-xr-x 27 postgres admin 918 12 Jun 15:19 bin drwx------ 2 postgres admin 68 11 Jun 08:10 data drwxr-xr-x 3 postgres admin 102 12 Jun 15:19 doc drwxr-xr-x 21 postgres admin 714 12 Jun 15:19 include drwxr-xr-x 20 postgres admin 680 12 Jun 15:19 lib drwxr-xr-x 3 postgres admin 102 11 Jun 08:10 log drwxr-xr-x 4 postgres admin 136 12 Jun 15:19 man drwxr-xr-x 3 postgres admin 102 12 Jun 15:19 share James also suggested I should: try this when changing to the postgres user: su - postgres the hyphen gives you an environment for the postgres user. Unfortunately, I either used the wrong syntax, or it doesn't work for some other reason: Acorn:/Library/PostgreSQL8 root# su - postgres su: no directory I wonder whether the above line, and the following, relate to the lack of a home for the postgres user? Acorn:/Library/PostgreSQL8 root# su postgres su: /dev/null/.bashrc: Not a directory 3. Another list member suggested off-list that: If you run the command as `sudo su postgres -c 'initdb'` then it should run the command as the postgres user but not require the postgres account to be a full account, which it requires if you just do su postgres and then run the command seperately... But I got the following: Acorn:/Library/PostgreSQL8 root# sudo su postgres -c 'initdb' su: line 1: initdb: command not found When I tried that again, but as acorn (my username) instead of root, terminal more promisingly said I had to specify the directory. What finally appeared to work, was the following: Acorn acorn 3 acorn$ sudo su postgres -c 'initdb -D /Library/PostgreSQL8/data' This gave me a pid, but looking in Activity Monitor that pid does not appear (nor anything else that looks like pg). I note that the directory /Library/PostgreSQL8/data/ still contains nothing, so for example this fails: pg_ctl start -l logfile -D /Library/PostgreSQL8/data pg_ctl: could not open PID file "/Library/PostgreSQL8/data/postmaster.pid": Permission denied I earlier downladed & installed the Postgres_Startup_Item.pkg, but either initdb didn't really work, or there's some other problem. I guess what I'm asking now is: how do I know if initdb has worked, and what do I do next to start pg? Sorry for the length. Cheers! Joe