pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Killing Processes
5+ messages / 3 participants
[nested] [flat]

* Killing Processes
@ 2005-04-23 15:58  Thomas F.O'Connell <tfo@sitening.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Thomas F.O'Connell @ 2005-04-23 15:58 UTC (permalink / raw)
  To: Ken Reid <Ken@homegain.com>; +Cc: pgsql-admin

It is generally not recommended that you kill processes with anything 
stronger than HUP, which is (I believe) what kill sends by default. 
Stronger signals will cause all backends to kill themselves because of 
paranoia about data corruption.

If the process does not respond to that, then there is no convenient 
way to kill it.

You can correlate processes to queries using the pg_stat_activity view.

-tfo

--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC

Strategic Open Source: Open Your i™

http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005

On Apr 22, 2005, at 6:03 PM, Ken Reid wrote:

> Hi Thomas.
>
> I have been searching high and low and cannot find a way to kill an
> individual
> user process with Postgres.
>
> I have tried using a kill -9 to kill a specific process but that 
> brings the
> entire postmaster down.
>
> This seems to be a very common problem with no answers.
>
> Would you happen to know how to do this?
>
> Thanks.
>
> - Ken



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Killing Processes
@ 2005-04-23 16:16  Michael Fuhr <mike@fuhr.org>
  parent: Thomas F.O'Connell <tfo@sitening.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Michael Fuhr @ 2005-04-23 16:16 UTC (permalink / raw)
  To: Thomas F.O'Connell <tfo@sitening.com>; +Cc: Ken Reid <Ken@homegain.com>; pgsql-admin

On Sat, Apr 23, 2005 at 10:58:46AM -0500, Thomas F.O'Connell wrote:
>
> It is generally not recommended that you kill processes with anything 
> stronger than HUP, which is (I believe) what kill sends by default. 

kill usually sends TERM by default, not HUP.

(I say "usually" only because I haven't personally examined every
implementation of kill in existence.  Every one I've used sends
TERM by default and I haven't heard of any that work otherwise.)

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Killing Processes
@ 2005-04-23 16:33  Thomas F.O'Connell <tfo@sitening.com>
  parent: Michael Fuhr <mike@fuhr.org>
  1 sibling, 0 replies; 5+ messages in thread

From: Thomas F.O'Connell @ 2005-04-23 16:33 UTC (permalink / raw)
  To: Michael Fuhr <mike@fuhr.org>; +Cc: pgsql-admin; Ken Reid <Ken@homegain.com>

Oops. That's right. I was relying on memory, which is less reliable 
than man. Fortunately, I always consult man before killing... :P

-tfo

--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC

Strategic Open Source: Open Your i™

http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005

On Apr 23, 2005, at 11:16 AM, Michael Fuhr wrote:

> On Sat, Apr 23, 2005 at 10:58:46AM -0500, Thomas F.O'Connell wrote:
>>
>> It is generally not recommended that you kill processes with anything
>> stronger than HUP, which is (I believe) what kill sends by default.
>
> kill usually sends TERM by default, not HUP.
>
> (I say "usually" only because I haven't personally examined every
> implementation of kill in existence.  Every one I've used sends
> TERM by default and I haven't heard of any that work otherwise.)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Killing Processes
@ 2005-04-23 18:00  Christopher Browne <cbbrowne@acm.org>
  parent: Michael Fuhr <mike@fuhr.org>
  1 sibling, 1 reply; 5+ messages in thread

From: Christopher Browne @ 2005-04-23 18:00 UTC (permalink / raw)
  To: pgsql-admin

In the last exciting episode, mike@fuhr.org (Michael Fuhr) wrote:
> On Sat, Apr 23, 2005 at 10:58:46AM -0500, Thomas F.O'Connell wrote:
>>
>> It is generally not recommended that you kill processes with anything 
>> stronger than HUP, which is (I believe) what kill sends by default. 
>
> kill usually sends TERM by default, not HUP.
>
> (I say "usually" only because I haven't personally examined every
> implementation of kill in existence.  Every one I've used sends
> TERM by default and I haven't heard of any that work otherwise.)

The only "normative" standard that would seem meaningful would be
POSIX.  A quick "google" doesn't find anything relevant there.  

The most relevant thing is pointers to the GNU utilities, which is
where the "kill" used on Linux comes from.  The man page for that
indicates TERM as the default, and later has pointers to POSIX.1 as
its 'source of authority.'

I'd hazard the guess that perhaps that default was declared in POSIX,
which is at least a form of standard.  It may not be normative for
BSD, but it is still instructive...

Have you ever had a "bad day" when you issued "kill -3" rather than
"kill 2"?  I have also had the day when part of me wanted "kill it
now; kill -3", another part knew "No, you should just use kill -2, and
wait...", and my treacherous fingers wound up taking the wrong side in
the conflict ;-).
-- 
"cbbrowne","@","ntlug.org"
http://cbbrowne.com/info/internet.html
Rules of the Evil Overlord #144. "I will order my guards to stand in a
line  when they shoot  at the  hero so  he cannot  duck and  have them
accidentally shoot each  other. Also, I will order  some to aim above,
below, and to the sides so he cannot jump out of the way."
<http://www.eviloverlord.com/;



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Killing Processes
@ 2005-04-23 20:43  Michael Fuhr <mike@fuhr.org>
  parent: Christopher Browne <cbbrowne@acm.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Fuhr @ 2005-04-23 20:43 UTC (permalink / raw)
  To: Christopher Browne <cbbrowne@acm.org>; +Cc: pgsql-admin

On Sat, Apr 23, 2005 at 02:00:11PM -0400, Christopher Browne wrote:
> In the last exciting episode, mike@fuhr.org (Michael Fuhr) wrote:
> >
> > kill usually sends TERM by default, not HUP.
> >
> > (I say "usually" only because I haven't personally examined every
> > implementation of kill in existence.  Every one I've used sends
> > TERM by default and I haven't heard of any that work otherwise.)
> 
> The only "normative" standard that would seem meaningful would be
> POSIX.  A quick "google" doesn't find anything relevant there.  

Yeah, I meant to check that.  My quick google yielded the following:

http://www.opengroup.org/onlinepubs/009695399/utilities/kill.html

"The sig argument is the value specified by the -s option, - signal_number
option, or the - signal_name option, or by SIGTERM, if none of these options
is specified."

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2005-04-23 20:43 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-23 15:58 Killing Processes Thomas F.O'Connell <tfo@sitening.com>
2005-04-23 16:16 ` Michael Fuhr <mike@fuhr.org>
2005-04-23 16:33   ` Thomas F.O'Connell <tfo@sitening.com>
2005-04-23 18:00   ` Christopher Browne <cbbrowne@acm.org>
2005-04-23 20:43     ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox