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

From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(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 19:07:32
Message-ID: 3AA53574.B29B7645@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Well, if you have something clever you want to do if the postmaster
> doesn't come down after an orderly shutdown then please share it. The
> current alternatives are 'leave running' or 'kill -9'. I know I'd prefer
> the former.

Well, my preferences aren't really relevant here. I have a job to do as
an initscript in the RPMish environment -- and I really have to meet my
obligations (using the first personal pronoun there to anthropomorph the
initscript to a person, allowing us to have a little sympathy for the
poor shell script's plight :-)).

My preference is to let it float in limbo -- if it's in limbo and won't
come out, then we have bigger issues.

However, I could do something really sneaky in the RedHat environment
and let init do the dirty work for me -- but, again, I am not at all
guaranteed that things will come down orderly -- if it is at all
possible for me to bring about an orderly (if slow) shutdown that does
terminate as the rest of the system needs it to do, then I'll attempt to
do so.

But, the immediate issue is preventing chaotic stops within the
initscript, so I'm going to experiment with things and see if I can make
the initscript hang -- if I can't, then I'll likely put in the 'killproc
postmaster -INT' with escalation to -TERM if it doesn't come down within
sixty seconds (and, no, I am not going to sleep 60 then check things --
I am going to sleep 1 and loop sixty times) -- no need to unnecessarily
delay system shutdown (and potential restart). And I won't put in the
-KILL unless I can find a safe and thorough way to do so.

Or I may go ahead and pg_ctl-ize things and let pg_ctl do the dirty
work, as that IS what pg_ctl is supposed to accomplish.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2001-03-06 19:12:16 Re: How to shoot yourself in the foot: kill -9 postmaster
Previous Message Jarom Hagen 2001-03-06 19:02:40 COBOL