what's left for 1.5.0

Corinna Vinschen vinschen@redhat.com
Wed Jun 11 09:43:00 GMT 2003

On Tue, Jun 10, 2003 at 04:35:26PM -0400, Jason Tishler wrote:
> Are you willing to do the "honors"?  Or, would you like me to submit
> patches for the DLL and/or inetd?

It's easy enough to change Cygwin.  I just don't quite see why inetd should
get patched.  Inetd doesn't have a need to clean up and it has no handling
to send signals to its children so far.  Do you think it should?  In that
case it would just send SIGTERM to all processes in the same process group. 
Is that what you're suggesting?  Somehow that's the same as still having 
the CTRL_SHUTDOWN_EVENT handled in Cygwin ;-)

Btw., if MSDN is right that only service processes get a CTRL_SHUTDOWN_EVENT
message, how comes that postmaster started from cygrunsrv also gets a
SIGTERM?  Is MSDN wrong or better, is it not thouroughly enough describing
what happens?

I examined the behaviour of sshd on shutdown.  Fortunately sshd and
cygrunsrv both create syslog entries when signal arrive and sshd does
handle SIGTERM and SIGQUIT equally.  So I changed the sshd service
entry to send SIGQUIT to sshd when the service is asked to stop.

A normal `net stop sshd' then looks like this:
  "sshd : PID 1024 : Received signal 3; terminating."

Shutting down the system looks like this:

  "sshd : PID 560 : Received signal 15; terminating."
  "sshd : PID 504 : `sshd' service stopped."
  "sshd : PID 504 : Received signal `15', terminate child..."

The first entry is from sshd itself, the other two are from cygrunsrv.

So CTRL_SHUTDOWN_EVENT actually is send also to the services child
processes.  After removing sig_send(SIGTERM) from ctrl_c_handler(),
a shutdown looks exactly like a `net stop sshd'.

So far so good but what about Cygwin applications started from a
non-Cygwin service starter like SRVANY?  If anybody is using that one,
say,  because an application is not behaving "cygrunsrv aware" (forks
and execs for instance), then all these processes don't have a chance
to clean up.  What's our answer to this one?  Don't do that?


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

More information about the Cygwin-developers mailing list