Re: need to delete postmaster.pid file. automate it?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: need to delete postmaster.pid file. automate it?
Дата
Msg-id 22351.1052195774@sss.pgh.pa.us
обсуждение исходный текст
Ответ на need to delete postmaster.pid file. automate it?  (mlaks <mlaks@bellatlantic.net>)
Список pgsql-admin
mlaks <mlaks@bellatlantic.net> writes:
> I would like to automate this process of deleting postmaster.pid if
> postgresql is not running and would like to ask my question .

It is safe (and probably a good idea) to delete postmaster.pid in a
shell script that runs *ONLY DURING BOOTUP*.  Do *not* put such a
command into a script that you might run as a means of manually
restarting the postmaster --- because if you do, you just lost your
interlock against starting two postmasters for the same database.
Which, trust me, is not an interlock you want to lose.

There are quite a few other standard daemons, for instance sendmail,
that have similar issues with leftover lockfiles after a system
crash.  If you dig around in your boot scripts you may find one
that's already designed to remove unwanted lockfiles at system boot.
That'd be the place to add "rm /var/lib/pgsql/data/postmaster.pid".
But do not put it into anything that could be triggered after initial
system startup, unless you enjoy the sensation of shooting yourself
in the foot.

            regards, tom lane


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

Предыдущее
От: mlaks
Дата:
Сообщение: need to delete postmaster.pid file. automate it?
Следующее
От: "shoaib"
Дата:
Сообщение: Re: Database server restartig