From: | Mike Mascari <mascarm(at)mascari(dot)com> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: how to terminate a process when kill fails |
Date: | 2002-11-02 01:52:14 |
Message-ID: | 3DC32FCE.2060906@mascari.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Bruce Momjian wrote:
> Woh, the prohibition to using kill -9 is still valid. I can think of no
> reason to use -9 unless something is broken in our code or in the OS.
>
> pg_ctl code has:
>
> case "$shutdown_mode" in
> s|smart)
> sig="-TERM"
> ;;
> f|fast)
> sig="-INT"
> ;;
> i|immediate)
> sig="-QUIT"
> ;;
> and the 7.3 postgres manual page has:
>
> To stop a running query use the SIGINT signal. To
> tell postgres to reread the config file,
> use a SIGHUP signal. The postmaster uses SIGTERM
> to tell a postgres process to quit normally and
> SIGQUIT to terminate without the normal cleanup.
> These should not be used by users.
I confess it might have been over-kill to suggest 'Feel free to
kill -9 the postmaster'. However, I have seen FUD stating that
PostgreSQL cannot recover from crashes because of the TIP. It
seemed that Shaunn (quite naturally) came to the same conclusion:
>>>How can I kill processes without kill -9 <pid> and
>>>ruining the database?
^^^^^^^^^^^^^^^^^^^^
Also, Shaunn seemed to suggest that the postmaster and postgres
processes were not responding to typical signals..at least
SIGINT and SIGTERM:
>>>I've tried restarting postgreSQL hoping that it cleans up
>>>a few things. I've tried to simply kill the processes that
>>>were running. Nothing happens; nothing dies. I don't see
>>>much of anything in the messages / log files.
If Shaunn initially tried init scripts like those shipped with
Lamar's RPM, they do a fast shutdown - SIGINT. With those
signals ignored, Shaunn tried a (presumably) SIGTERM, which also
failed to shutdown the postmaster and postgres processes. I
should have first suggested that Shaunn also try SIGQUIT. But my
main point was that 'kill -9 <pid> does *not* corrupt the
database and neither would immediate power loss, for that
matter. And that Marc should consider changing the TIP. Of
course, removing the TIP altogether as Tom later suggested,
would seem to be the best course of action...
Mike Mascari
mascarm(at)mascari(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2002-11-02 02:35:40 | Re: [GENERAL] What user to defaults execute as? |
Previous Message | Justin Clift | 2002-11-02 01:42:47 | Re: [HACKERS] Database replication... - Mission Critical |