Re: How to shoot yourself in the foot: kill -9 postmaster - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How to shoot yourself in the foot: kill -9 postmaster
Date
Msg-id 3670.983846188@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to shoot yourself in the foot: kill -9 postmaster  (Lamar Owen <lamar.owen@wgcr.org>)
List pgsql-hackers
Lamar Owen <lamar.owen@wgcr.org> writes:
> Is 6.1 this different from 6.2?

Scott sent me a copy of /etc/init.d/functions from his box, and it has
largely the same behavior (I hadn't read the whole code to notice that
it doesn't use the default killlevel...).  What's actually happening
here is that the init script sends SIGTERM, and then SIGKILL four
seconds later if the postmaster hasn't shut down yet.  Unfortunately,
unless your clients are very short-lived four seconds isn't going to
be enough for a "polite" shutdown.  (It's pretty marginal even for
an impolite one, since a checkpoint will take at least a couple of
seconds.)

However, with an explicit kill level that doesn't happen: you get one
signal of the specified value, no more.  Possibly it would be better for
the init script to send SIGINT (forcibly disconnect clients) instead of
SIGTERM, however.  So I'm now leaning to "killproc postmaster -INT".
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to handle waitingForLock in LockWaitCancel()
Next
From: Tom Lane
Date:
Subject: Re: How to shoot yourself in the foot: kill -9 postmaster