On 10/27/14, 8:44 PM, Mike Kilmer wrote: > Hi friends. > > I'm on osX 10.8.5 and cannot seem to get postgreSQL running properly, > which may be due to having previously installed with macports. > > Here's the story: > > $ postgres > postgres cannot access the server configuration file > "/sw/var/postgresql-9.3/data/ > > $ sudo -u postgres psql > 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"? > > macbookpro1:postgresql-9.3 mikekilmer$ sudo tail -f > /sw/var/postgresql-9.3/pgsql.log > dyld: DYLD_ environment variables being ignored because main executable > (/usr/bin/sudo) is setuid or setgid > Password: > LOG: autovacuum launcher started > LOG: received fast shutdown request > LOG: aborting any active transactions > LOG: autovacuum launcher shutting down > LOG: shutting down > LOG: database system is shut down > postgres cannot access the server configuration file > "/sw/var/postgresql-9.3/postgresql.conf": No such file or directory > postgres cannot access the server configuration file > "/sw/var/postgresql-9.3/postgresql.conf": No such file or directory > LOG: could not open configuration file > "/sw/var/postgresql-9.3/postgresql.conf": Permission denied > FATAL: configuration file "/sw/var/postgresql-9.3/postgresql.conf" > contains errors > > root# su postgres > shell-init: error retrieving current directory: getcwd: cannot access > parent directories: Permission denied > bash-3.2$ pg_ctl -D /sw/var/postgresql-9.3/ -l /sw/var/log/pgsql-9.3.log > start > could not identify current directory: Permission denied > could not identify current directory: Permission denied > could not identify current directory: Permission denied > The program "postgres" is needed by pg_ctl but was not found in the > same directory as "pg_ctl". > Check your installation. > bash-3.2$ pwd > pwd: error retrieving current directory: getcwd: cannot access parent > directories: Permission denied > bash-3.2$ cd / > chdir: error retrieving current directory: getcwd: cannot access parent > directories: Permission denied > bash-3.2$ exit > > $grep postgres /etc/passwd > _postgres:*:216:216:PostgreSQL Server:/var/empty:/usr/bin/false > > root# su postgres > bash-3.2$ pwd > /etc > bash-3.2$ pg_ctl -D /sw/var/postgresql-9.3/ -l /sw/var/log/pgsql-9.3.log > start > server starting > bash-3.2$ sh: /sw/var/log/pgsql-9.3.log: Permission denied > > macbookpro1:etc root# open "/System/Library/CoreServices/Directory > Utility.app" > > Shows NFSHomeDirectory of PostgreSQL as /Library/PostgreSQL/9.2, which > doesn't exist.
Probably not relevant. That's nothing that Fink or Macports would have installed. > > And for PostgreSQL Server it's: /var/empty That's normal; our daemon users are normally set up without real home directories. > > A friend who is experienced with Postgres on Debian says permissions are > all messed up and recommended abandoning this route and using a virtual > box, but I'd like to get this working. > OS X isn't Linux, and Fink isn't Debian. > Hoping you might be able to offer some insight? I'd like to avoid a > clean OS install if possible. > > Thanks a bunch and have a great one. > > Mike* > > > > > > Michael Kilmer > Media Zoo > Music, Theater, Multimedia and Web Development > i...@mzoo.org <mailto:i...@mzoo.org> > 201-679-4168 > *www.mZoo.org <http://www.mZoo.org>* > www.m <http://www.IndieGogo.com/Joys>_adhappy.com <http://adhappy.com>_ > *www.explorepensacolahistory.com <http://www.explorepensacolahistory.com>* > *www.rivka.com <http://www.rivka.com>* > Nothing in what you've got suggests anything related to your prior Macports install. You're using the -D flag against a directory where there isn't a conf file. That's not going to work. Have you tried the suggested syntax from "fink info postgresql93"? I got what looked like a working database: Fiona:~ hansen$ sudo pgsql.sh start WARNING: You probably need to set your shared memory resources higher for PostgreSQL to function. For more information on raising your shared memory settings, see: http://wiki.finkproject.org/index.php/Shared_Memory_Regions_on_Darwin I am also creating a default configuration in /etc/sysctl.conf.pg that contains values that will work with the default PostgreSQL memory settings. To use it, rename it to /etc/sysctl.conf (if you don't have one already) and reboot. For now, I'll try setting your sysctl to something higher and then running things anyways. Good luck! =) kern.sysv.shmmax: 4194304 -> 8388608 kern.sysv.shmmin: 1 -> 1 kern.sysv.shmmni: 32 sysctl: kern.sysv.shmmni: Operation not permitted kern.sysv.shmseg: 8 -> 8 kern.sysv.shmall: 1024 -> 32768 server starting Fiona:~ hansen$ sudo -u postgres /sw/opt/postgresql-9.3/bin/createdb mydb Fiona:~ hansen$ sudo -u postgres /sw/opt/postgresql-9.3/bin/pg_dump mydb -- -- PostgreSQL database dump -- SET statement_timeout = 0; SET lock_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; -- -- Name: public; Type: ACL; Schema: -; Owner: postgres -- REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC; -- -- PostgreSQL database dump complete -- -- Alexander Hansen, Ph.D. Fink User Liaison My package updates: http://finkakh.wordpress.com/ ------------------------------------------------------------------------------ _______________________________________________ Fink-beginners mailing list Fink-beginners@lists.sourceforge.net List archive: http://news.gmane.org/gmane.os.apple.fink.beginners Subscription management: https://lists.sourceforge.net/lists/listinfo/fink-beginners