delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/26/10:22:00

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <40B4A7CB.1000402@ics.de>
Date: Wed, 26 May 2004 16:20:59 +0200
From: Thomas Kloeber <kloeber AT ics DOT de>
Reply-To: kloeber AT ics DOT de
Organization: ICS GmbH (http://www.ics.de)
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Signal Handling of CYGWIN under VMware Workstation
X-IsSubscribed: yes

  Folks'es,

i'm using cygwin 1.5.9-1 on Windows NT 4SP6 and W2K, both of which run 
on top of VMware Workstation 4.5.1 (host system is W2K on a Dell 
Precision 340).

i have a problem with a database application server (a port from Unix 
using cygwin): if i shut down the application from a bash/ksh via CTRL+C 
the application receives the signal but, instead of performing its 
shutdown procedure, the process dissappears immediately, leaving my DB 
in an inconsitent state. if i do the same from a DOS cmd, the server 
process shuts down ok.

i see the same behaviour if i shutdown the process via a 'control 
panel', which sends the server process a SIGTERM, in 2 out of 3 cases 
the process stops immediately without performing its proper shutdown.

however, if i run the application incl cygwin on a native system, 
everything works just fine.

so my question is, what is the connection/difference between VMware and 
Cygwin signal handling?

thomas

i have written a little test program which demonstrates the behaviour. 
if i run it in a ksh and hit CRTL+C, the process receives the signal and 
terminates. if i run it in DOS cmd, the process receives the signal, 
does its count down and then terminates:

#include "stdafx.h"
#include "signal.h"
#include <windows.h>
#include <stdio.h>

void goHome(int s)
{
    printf("Received signal %d\n", s);
    for (int i = 10; i > 0; i--) {
        printf("Need %2d more seconds to terminate\r", i);
        Sleep(1000L);
    }
    exit(0);
}

int
main(int argc, char *argv[])
{
    signal(SIGINT, goHome);

    printf("Hit Ctrl+C to terminate me\n");
    while (1) {
        Sleep(1000);
    }

    return 0;
}

-- 
It has never been easier to help someone who suffers from hunger,
and use the web for a good purpose: http://www.thehungersite.com/



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019