Re: how to terminate a process when kill fails
От | Mike Mascari |
---|---|
Тема | Re: how to terminate a process when kill fails |
Дата | |
Msg-id | 3DC32FCE.2060906@mascari.com обсуждение исходный текст |
Ответ на | Re: how to terminate a process when kill fails (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | 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@mascari.com
В списке pgsql-general по дате отправления: