Thread: postgres init script reports failure, but postmaster started

postgres init script reports failure, but postmaster started

From
IN Conny
Date:
Hi all,
I'm not sure if the following is a bug or not. The symptoms I have is pretty much like this bug
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=166117
which have been documented in various archives. However, I run postgres 8.1.

What I do is i try to restore from a backup. I have a base backup and some archived WALs which I restore from.

If I, as a final step in the restoration, start up postgres with '/etc/init.d/postgresql-8.1 start' it will print [fail] to the shell and exit. This happens about halfway through the restoration of WAL archives.
However, if I call '/etc/init.d/postgresql-8.1 status' it says that the status is online; the database is running. If I examine the logs it seems that the startup has continued running beyond the point where it stopped printing to shell. All WAL archives are restored. And the content of the database seems to be ok.

I also tried to use '/usr/lib/postgresql/8.1/bin/pg_ctl start' to start up the database instead of the /etc/init.d script. This works without any error messages.

Could I safely assume that the restoration was successful, although /etc/init.d/postgresql-8.1 says it failed?

Best,
I.N.



Stava rätt! Stava lätt! Yahoo! Mails stavkontroll tar hand om tryckfelen och mycket mer! Få den på http://se.mail.yahoo.com

Re: postgres init script reports failure, but postmaster started

From
Tom Lane
Date:
IN Conny <in.conny@yahoo.se> writes:
> If I, as a final step in the restoration, start up postgres with '/etc/init.d/postgresql-8.1 start' it will print
[fail]to the shell and exit. This happens about halfway through the restoration of WAL archives. 

You're probably using an init script that is coded to report failure if the
postmaster isn't allowing connections within 60 seconds or so of being
started.  This is mostly cosmetic, but you might want to adjust the script.

            regards, tom lane