public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Signal Handling of CYGWIN under VMware Workstation
@ 2004-05-26 15:50 Thomas Kloeber
  2004-05-26 16:17 ` Signal Handling of cygwin " Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Kloeber @ 2004-05-26 15:50 UTC (permalink / raw)
  To: cygwin

  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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-26 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-26 15:50 Signal Handling of CYGWIN under VMware Workstation Thomas Kloeber
2004-05-26 16:17 ` Signal Handling of cygwin " Christopher Faylor
2004-05-26 16:51   ` Thomas Kloeber
2004-05-26 16:58     ` Brian Ford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).