Re: [GENERAL] Shutting down a warm standby database in 8.2beta3

From: Stephen Harris <lists(at)spuddy(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Date: 2006-11-18 03:54:55
Message-ID: 20061118035455.GB5891@pugwash.spuddy.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Nov 17, 2006 at 10:49:39PM -0500, Tom Lane wrote:
> Stephen Harris <lists(at)spuddy(dot)org> writes:
> > However, it seems the signal wasn't sent at all.
>
> Now that I think about it, the behavior of system() is predicated on the
> assumption that SIGINT and SIGQUIT originate with the tty driver and are
> broadcast to all members of the session's process group --- so the

> This does not apply to signals originated by the postmaster --- it
> doesn't even know that the child process is doing a system(), much less
> have any way to signal the grandchild. Ugh.

Why not, after calling fork() create a new process group with setsid() and
then instead of killing the recovery thread, kill the whole process group
(-PID rather than PID)? Then every process (the recovery thread, the
system, the script, any child of the script) will all receive the signal.

--

rgds
Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-11-18 04:40:36 Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Previous Message Stephen Harris 2006-11-18 03:52:15 Re: [HACKERS] Shutting down a warm standby database in 8.2beta3

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-11-18 04:40:36 Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Previous Message Stephen Harris 2006-11-18 03:52:15 Re: [HACKERS] Shutting down a warm standby database in 8.2beta3