The attached patch implements a formal method for conveying error messages to the user in the event that pg_ctl fails to start postgres. This is accomplished in the following manner: 1) Using -d to daemonize so that we are able to capture stderr (as opposed to silent mode) 2) Using command substition syntax to perform the capturing process 3) Conveying the message as a secondary parameter to eend, should an error occur NOTE: this patch also contains the fix detailed in bug 310045. One way to test this patch is to change the ownership of the $PGDATA directory to root. That will prevent postgres from starting and, rather than displaying no meaningful message to the user, it should terminate as thus: * Starting PostgreSQL ... pg_ctl: could not open PID file "/var/lib/postgresql/8.4/data/postmaster.pid": Permission denied [ !! ] * ERROR: postgresql-8.4 failed to start
Created attachment 224589 [details, diff] Implement meaningful start() error handling
Created attachment 224591 [details, diff] Implement meaningful start() error handling (errata) Oops, last patch introduced an unintended change relative to the existing script. This one is good.
Addressed in bug #311047
Committed.