Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Posts
    1

    Question Unanswered: Problem starting pgsql server on Mac OS X. Pg_hba.conf reading permission.

    Hello.
    Iím having a problem starting server on mac os x.

    -------------
    bash-3.2$ /usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data
    server starting
    bash-3.2$ LOG: could not open configuration file "/usr/local/pgsql/data/pg_hba.conf": Permission denied
    FATAL: could not load pg_hba.conf
    -------------

    The problem appears after changing permissions for /data folder in finder. I did this:

    Iím installing postgresql 8.4 from MacOS binary and it installs and starts ok. Then I try to edit pg_hba.conf in pgAdmin3 to add a line
    --------------
    host all all 10.0.0.6 md5
    --------------
    After I click save icon to save a file it doesnít save Ė probably it doesnít have enough permission for that. So I go to my /usr/local/pgsql/data/ folder in Finder Ė unlock itís permissions and set read/write to everyone group. Then I edit the pg_hba file with TextEdit.app and it looks like this

    -------------
    # "local" is for Unix domain socket connections only
    local all all trust
    # IPv4 local connections:
    host all all 127.0.0.1/32 trust
    host all all 10.0.0.6 md5
    # IPv6 local connections:
    host all all ::1/128 trust
    -------------

    Then server doesnít start Ė start server.app exits with non-zero value. Command line returns
    -------------
    BigMac:~ postgres$ FATAL: data directory "/usr/local/pgsql/data" has group or world access
    DETAIL: Permissions should be u=rwx (0700).

    chmod 700 /usr/local/pgsql/data/
    BigMac:~ postgres$ /usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data

    server starting
    BigMac:~ postgres$ LOG: could not open configuration file "/usr/local/pgsql/data/pg_hba.conf": Permission denied
    FATAL: could not load pg_hba.conf
    -------------

    Iíve tried installing postgre from source thru fink, and the problem stays the same. Iím really stuck here, and I really need postgre to be accessed from 10.0.0.6 machine.
    What am I doing wrong? As I understand itís a folder access permission problem, but I donít know how to fix it. Can anyone PLEASE help me?

  2. #2
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    You need to change your file permissions back. Only the postgres user should have r/w on that file and the whole directory in fact.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •