This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Cygwin service doesn't get NT shutdown notification -- IT DOES NOW!


Thanks to a hint from Jason Tishler, I found that I overlooked one
reference to "SHUTDOWN" in the Cygwin source code.  (D'oh!)  That code
sends SIGHUP to itself in response to some window shutdown event.  I
don't think this shutdown event is the same as the SCM shutdown event,
but in any case it kills the Cygwin process before the SCM-invoked
handler gets a chance to run.

I added code to my test service to catch, report, and otherwise ignore
all signals.  Then I started the service and left it running while I
restarted my NT system (what a PITA test...).  After reboot I see in
the log file that SIGHUP was received.  And now the service control
handler also runs, getting the SHUTDOWN event and leading to clean
process shutdown.  Finally.

Thanks for the help, all who responded.

Fred Yankowski       tel: +1.630.879.1312
Principal Consultant       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

Want to unsubscribe from this list?
Check out:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]