| Summary: | postgresql-server-8.3: incorrect permissions on /var/run/postgresql | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Marti Raudsepp <marti> |
| Component: | New packages | Assignee: | PgSQL Bugs <pgsql-bugs> |
| Status: | RESOLVED INVALID | ||
| Severity: | major | ||
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
I assume you mean dev-db/postgresql-server? Just postgresql-server is ambiguous. But obviously the first who didn't read the messages spit out by the ebuild:
"Please note that the standard location of the socket has changed from /tmp"
"to /var/run/postgresql and you have to be in the 'postgres' group to access"
"the socket."
"This can break applications which have the standard location hard-coded."
"If such an application links against the libpq, please re-emerge it,"
"if that doesn't help or the application accesses the socket without using libpq,"
"please file a bug-report."
"You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
I did added myself to group "postgres" re-log IN but still couldn't access the socket. However, changing permission to: /var/run/postgresql directory mode to 0771 solved the problem. So what is the point being in group "postgres" since it doesn't work. |
In the new and recent postgresql-server-8.3.3 ebuild, the daemon is configured to listen on the local socket in /var/run/postgresql.s.PGSQL.5432 . However, this directory is set to permissions 0770, in the ebuild: keepdir /var/run/postgresql fperms 0770 /var/run/postgresql Obviously, what this means, is that no ordinary user is permitted to connect to PostgreSQL: % psql psql: could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? The fix is to change the /var/run/postgresql directory mode to 0771 or greater. (Seriously, am I the first to actually try installing this ebuild? ;) Reproducible: Always Steps to Reproduce: 1. install postgresql-server-8.3.3 2. Create the database and run /etc/init.d/postgresql-8.3 start 3. run 'psql' as an ordinary user