Postgresql 7.2.3-r1 ebuild adds postgres user with shell '/bin/false' which makes starting postgresql database with postgresql init script impossible (it can't do 'su - postgres'). Shell has to be changed manually to /bin/sh for example. Strange that ebuild contains 'useradd -g postgres -s /bin/bash -d /var/lib/postgresql -c "postgres" postgres' but still postgres user gets '/bin/false' for shell.
Eric: Does this line work for you? sudo -u ${PGUSER} "${EXE} ${PGOPTS} -p ${PGPORT} 2>&1" | logger -p ${FACILITY}.notice 1>&2 &
I have the same problem. The above start-up command does not work.
I had this same problem. However, changing the shell to /bin/true worked for me. YMMV
Actually that didn't work but the init script returns "ok". So I set the postgres shell to /bin/bash in /etc/passwd and tried: # PGDATA=/var/lib/postgres sudo -u postgres "/usr/bin/postgres" and got back: FATAL 1: File /var/lib/postgresql/PG_VERSION is missing. This is not a valid data directory. I think the ebuild left out the initdb step. I manually did this: # su - postgres -c "/usr/bin/initdb -D $PGDATA" Now everything starts up fine. I'd love it if I could make the shell for my postgres user something safe, so please let me know your thoughts. I can set the shell to /bin/true and the following works: # sudo -u postgres /usr/bin/pg_ctl start -D $PGDATA -s -l $PGLOG However if I try /etc/init.d/postgresql start I get no postmaster processes. Furthermore, /etc/init.d/postgresql start and stop cease to work. Start says I already have it running and stop says there's nothing there! I know very little about ebuilds or the Gentoo startup scripts having installed 5 days ago. If anyone has an idea why the user's shell matters for the init script but not for a manual startup, please pass it along.
Can anyone provide a patch to the ebuild to make it so that the database directory is owned by postgres w/ /bin/false as the shell?
I agree. There should be an initdb phase, BUT WITH CHECKS, to see if it already exists, or not, based on the conf.d/postgresql PGDATA variable. Second, yes, /bin/true would work. However, even the postgresql maintainers themselves suggest a real shell, since you will have to use that account for managing postgresql itself, anyway. This is not unlike other powerful RDBMs, including Oracle and IBM DB2.
*** Bug 11276 has been marked as a duplicate of this bug. ***
Experienced the same problem described in this bug. Used Webmin to look at server data. Webmin Gentoo module for PostgreSQL shows /var/lib/postgresql as the $PGDATA directory("Path to host access config file", that is, pg_hba.conf. Changed this entry to: "/var/lib/postgresql/data/pg_hba.conf" and then used Webmin Users and Groups to modify the user postgres to use /bin/bash as the shell. Went back to Webmin PostgreSQL server admin page and started PostgreSQL from there. Checked processes and postmaster is now running. After "emerge postgresql" is conplete you have to run: ebuild /usr/portage/dev-db/postgresql/postgresql-7.3.3.ebuild config to set up postgreSQL properly. There is a message at the conpletion of the emerge for PostgreSQL that directs you to do this and a second message to ensure that the user postgres in the /etc/passwd file has /bin/bash or /bin/true set as the shell.
*** Bug 9829 has been marked as a duplicate of this bug. ***
*** Bug 14294 has been marked as a duplicate of this bug. ***
*** Bug 15701 has been marked as a duplicate of this bug. ***
Seems this is fixed, based on comment #8. Is this true?
If this bug isn't fixed, it should be. If it is, it should be closed. Besides, we're onto Postgres 7.3.x these days.
closing as fixed