This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: ctrl_c_handler() vs. cygrunsrv shutdown handling problem
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Thu, 29 May 2003 13:25:50 -0400
- Subject: Re: ctrl_c_handler() vs. cygrunsrv shutdown handling problem
- References: <20030529171235.GB724@tishler.net>
- Reply-to: cygwin-developers at cygwin dot com
On Thu, May 29, 2003 at 01:12:36PM -0400, Jason Tishler wrote:
>The SIGTERM signal sent by Cygwin's ctrl_c_handler() is interfering with
>cygrunsrv's shutdown handling -- at least for PostgreSQL. See the
>attached for an example of this problem.
>
>The bottom line is ctrl_c_handler()'s SIGTERM signal arrives before the
>SIGINT signal sent by cygrunsrv. This causes PostgreSQL to perform a
>"smart" instead of a "fast" shutdown which can cause an improper
>shutdown -- at least under XP. It is possible that other Unix daemons
>may be adversely affected by this double signal problem too.
>
>I verified that preventing Cygwin from sending the SIGTERM:
>
> @@ -933,7 +933,7 @@ ctrl_c_handler (DWORD type)
> is shut down or console window is closed. */
> if (type == CTRL_SHUTDOWN_EVENT)
> {
> - sig_send (NULL, SIGTERM);
> + // sig_send (NULL, SIGTERM);
> return FALSE;
> }
> if (type == CTRL_CLOSE_EVENT)
>
>works around the problem.
>
>I'm willing to work up a patch to fix this problem properly.
>Unfortunately, the only solution I can think of is a new CYGWIN setting.
>Is this acceptable? If not, any other ideas?
Why not add an option to have cygrunsrv set SIGTERM to SIG_IGN?
cgf