From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040404 Firefox/0.8 Description of problem: PostgreSQL failed to start up after an upgrade from Fedora Core 2 from Fedora Core 1. Init scripts failing, reporting "Ambiguous output redirect." error. The init scripts initially reported that an old database format was found, which needed to be manually upgraded. Renamed the /var/lib/pgsql directory as a temporary measure to test the new server. Ran the command "service postgresql start" and got "Ambiguous output redirect." message, server didn't start or initialise a fresh database. Problem fixed itself following re-installation of PostgreSQL: rpm -e --nodeps postgresql-server rm -rf /var/lib/pgsql rpm -Uvh postgresql-server-7.4.2-1.i386.rpm I got it working in the end, but it may be a potential problem area for other users. (?) Version-Release number of selected component (if applicable): postgresql-server-7.4.2-1 initscripts-7.53-1 bash-2.05b-38 How reproducible: Didn't try Steps to Reproduce: Not sure how easily reproducible this is, but: - Running PostgreSQL fine on Fedora Core 1 - Upgraded to Fedora Core 2 - PostgreSQL stopped working, as described above Actual Results: When startup script is run (including boot-up), after removing old databases: Initializing database: Ambiguous output redirect. [FAILED] Starting postgresql service: Ambiguous output redirect. [FAILED] Expected Results: Initializing database: [ OK ] Starting postgresql service: [ OK ] Additional info: The error accompanying "initializing database" comes from the line: su -l postgres -c "/usr/bin/initdb --pgdata=$PGDATA > /dev/null 2>&1" < /dev/null The error accompanying "starting postgresql service" comes from the line: su -l postgres -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o '-p ${PGPORT} ${PGOPTS}' start > /dev/null 2>&1" < /dev/null
The only theory that comes to mind is that you had a nonstandard shell (csh or some other non-sh-syntax shell) selected for the postgres user in your FC1 installation. The remove/reinstall would have fixed it by deleting and recreating the postgres user's /etc/passwd entry. Does this sound right at all? The previous version of the init script would work anyway because it included "-s /bin/sh" in the su commands, but that was removed recently on the grounds that people wanted the postgres user's normal profile (eg, .bash_profile) to get read when starting the postmaster. Possibly we could compromise by putting the /dev/null output redirection outside the su -c command.
I also got the warning that PostgreSQL could not start the database because an old version was there. Renamed /var/lib/pgsql and used "service start". PostgreSQL started OK. But how to upgrade/use the old database?
I use tcsh as shell for both my normal account and root, but don't remember changing it for postgres. It seems unlikely that I did, as it's very seldom I have reason to su to postgres. For an answer to Flavio Cardone's query, see: http://www.postgresql.org/docs/7.4/static/install-upgrading.html I presume Flavio would have to temporarily revert to the old version in order to dump the databases.
Well, indeed if I change the postgres user's shell to tcsh, I get the same symptoms you describe, so I'm pretty sure that must be what you did. I'll look into fixing the initscript to defend against this without losing the other feature.
Fixed in postgresql 7.4.3-1.