Skip site navigation (1) Skip section navigation (2)

Re: How to shoot yourself in the foot: kill -9 postmaster

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to shoot yourself in the foot: kill -9 postmaster
Date: 2001-03-06 02:36:28
Message-ID: 3670.983846188@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Lamar Owen <lamar(dot)owen(at)wgcr(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Lamar OwenDate: 2001-03-06 02:36:56
Subject: Re: How to shoot yourself in the foot: kill -9 postmaster
Previous:From: Thomas LockhartDate: 2001-03-06 02:34:17
Subject: Re: CORBA and PG

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group