running ebuild /var/db/postgres-<whatever/postgres-<whatever>.ebuild config sets up directories & co and then says you can run postgres via /etc/init.d/postgresql start. But if you edit conf.d/postgresql to place the log file in another directory (/var/log, for example) it won't start. That's because the ebuild does not touch & chmod it. The default path works ok because the dir is owned by postgres user. Quick & easy solution: add to the config section of the ebuild something like touch $POSTGRES_LOG_FILE chown $POSTGRES_UID:$POSTGRES_GID $POSTGRES_LOG_FILE chmod 600 $POSTGRES_LOG_FILE Reproducible: Always Steps to Reproduce: 1. emerge postgresql 2. edit /etc/conf.d/postgresql and move the log file somewhere else 3. ebuild config 4. try to start the db Actual Results: * Starting PostgreSQL... sh: line 1: /var/log/postgresql.log: Permission denied Expected Results: it should have worked ok :) I'm using postgresql-8.0.1-r2, didn't check other versions.
Why is this a bug? The ebuild works, if you want to move postgresql log to somewhere else, then set the location _after_ you have run ebuild config and set the permissions as needed...
Why shouldn't it be a bug, even if it's a small one? I thought that if there is the ebuild config stuff, and if it in the end says "OK, you're setup, run init.d/postgresql start, be happy", it should give me a consistent setup. If you want the user and not the ebuild to take care of a touch & chmod, then remove all the ebuild config stuff and tell him to RTFM and setup postgres himself. That will leave you in a consistent state, and not in an halfway one. If that's not possible, the "Success. You can now start the database server using blahblah" message is actually a bug because it's wrong, and it should be changed in something like "Success. Maybe you can now start the database server, but look around if you eventually have to do something else before". PS, the first thing you can setup in conf.d/postgresql is the database directory. And you need to do that *before* running the ebuild config. Same applies for $PGUSER.
This works just fine by default; if you need another location, see comment #1