Bug 124024 - PostgreSQL wont start up if postgres user's shell is not sh-like
Summary: PostgreSQL wont start up if postgres user's shell is not sh-like
Alias: None
Product: Fedora
Classification: Fedora
Component: postgresql   
(Show other bugs)
Version: 2
Hardware: All Linux
Target Milestone: ---
Assignee: Tom Lane
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2004-05-23 00:07 UTC by James Turner
Modified: 2013-07-03 03:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-06-23 23:01:30 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:307 normal SHIPPED_LIVE Updated rh-postgresql packages 2004-08-02 04:00:00 UTC

Description James Turner 2004-05-23 00:07:51 UTC
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

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.
Starting postgresql service: Ambiguous output redirect.

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

Comment 1 Tom Lane 2004-05-23 00:33:20 UTC
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.

Comment 2 Flavio Cardone 2004-05-23 15:11:06 UTC
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

Comment 3 James Turner 2004-05-26 17:23:08 UTC
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:


I presume Flavio would have to temporarily revert to the old version
in order to dump the databases.

Comment 4 Tom Lane 2004-05-26 21:50:21 UTC
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.

Comment 5 Tom Lane 2004-06-23 23:01:30 UTC
Fixed in postgresql 7.4.3-1.

Note You need to log in before you can comment on or make changes to this bug.