[ANNOUNCEMENT] Updated: cygrunsrv-0.94-1

Fred Yankowski fred@ontosys.com
Mon Jul 16 11:15:00 GMT 2001


On Mon, Jul 16, 2001 at 07:15:53PM +0200, Corinna Vinschen wrote:
> > A Unix system would typically give daemon processes a chance to
> > shutdown cleanly between run-levels through the use of /etc/init.d
> > scripts (or the like), before hammering them with a signal.
> 
> Not neccessarily. From the Linux man page init(8):
> 
>        When  init  is  requested to change the runlevel, it sends
>        the warning signal SIGTERM to all processes that are unde­
>        fined in the new runlevel.  It then waits 5 seconds before
>        forcibly terminating these processes via the SIGKILL  sig­
>        nal.

I think that applies only to processes that init is managing directly
because of their entries in /etc/inittab.  In systems like Debian
GNU/Linux that provide /etc/init.d scripts, init runs /etc/init.d/rc
on any change in run-level and that script goes through the
appropriate /etc/rc?.d directory and runs all the K* and S* (kill and
start) symlinked scripts there.  I'm not aware of any particular limit
on how long those scripts can take -- I've seen a run-level change
take a _very_ long time when I wrote a stop script incorrectly and the
script would hang.  It doesn't look like init ever sends _any_ signal
to those processes that are managed indirectly through init.d scripts
-- it doesn't even know about those processes.

In the case of Cygwin, I'm concerned that a SIGTERM signal sent by
ctrl_c_handler() would beat the signal sent (via the --shutdown
option) by cygrunsrv, causing the daemon to embark on the wrong
shutdown mode.

The amount of time allowed for shutdown might be another issue,
but we could address that one as you suggested, by having cygrunsrv
interact with the Service Control Manager to request more time.  I
haven't found a need for this in practice.

-- 
Fred Yankowski           fred@OntoSys.com      tel: +1.630.879.1312
Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list