Kevin Grittner wrote:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>
>> In general I'd not recommend that an init script go messing with the
>> contents of the postmaster.pid file, which it would have to do to
>> have any of this logic in the script.
>>
>
> But LSB specifically provides the pidofproc function to extract the
> pid info.
>
I think Tom meant that you don't want to modify the contents of that
file (or its timestamp). Reading from the file (and using the data
there) is a whole different story, and is - in part - why the file
exists in the first place.
>
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html
>
> This brings me back round to what I was looking at recently -- the
> possibility of trying to make an LSB-conforming init script for
> PostgreSQL. I'm having a lot of trouble, though, trying to get either
> the postmaster or pg_ctl to behave well with the start_daemon function
> implementations available to me. Is there a fundamental mismatch
> there, or am I probably just missing some crucial detail? (The
> killproc function seems to work just fine, however, as long as I use
> the -p switch and give it the right signal.)
>
> And there's the usual question: is there interest in such a script?
>
The script is undoubtedly useful, if nothing more than to provide a
template for Linux distros. However, I think by itself it is used quite
broadly by admins that choose to install from source rather than using a
pre-packaged distribution.
Some time ago I started work on a HeartBeat/OpenAIS resource management
script for PostgreSQL to integrate it more closely with HeartbeatV2 (to
support resource monitoring on a standby, auto-setup of standby node,
etc.) but haven't worked on it since hitting a couple walls that are
somewhat related to this issue. Having a better (and foolproof)
start/stop LSB script would definitely help that project when I get back
to it..
--
Chander Ganesan
Open Technology Group, Inc.
One Copley Parkway, Suite 210
Morrisville, NC 27560
919-463-0999/877-258-8987
http://www.otg-nc.com