Re: Question on start server using PG_CTL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question on start server using PG_CTL
Дата
Msg-id 18222.1249314596@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Question on start server using PG_CTL  ("Mark Steben" <msteben@autorevenue.com>)
Список pgsql-admin
"Mark Steben" <msteben@autorevenue.com> writes:
> Is it possible that, during startup, postmaster.pid takes a second or two to
> be created and hadn't been created yet when the test was run?

It's not instantaneous, for sure.  For one thing, the kernel could be
scheduling the postmaster at lower priority than the continued execution
of your startup script.  If you don't have any sleep at all in there
then the risk of failure would be quite high, even assuming the
postmaster would create the pidfile instantaneously once it gets to run.
And there are other things it has to do first, like read the config file
so it knows where the data directory is ...

Since you say you're using pg_ctl, why don't you use its -w option and
not let the script proceed until you know the postmaster is up?

            regards, tom lane

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Mark Steben"
Дата:
Сообщение: Question on start server using PG_CTL
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Postgres has stopped listening on port 5432...