delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/16/14:16:09

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Authentication-Warning: shell-2.enteract.com: fcy set sender to fred AT ontosys DOT com using -f
Date: Mon, 16 Jul 2001 13:14:46 -0500
From: Fred Yankowski <fred AT ontosys DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] Updated: cygrunsrv-0.94-1
Message-ID: <20010716131446.A5448@enteract.com>
References: <20010716171908 DOT V25442 AT cygbert DOT vinschen DOT de> <20010716113429 DOT D614 AT dothill DOT com> <20010716182727 DOT Y25442 AT cygbert DOT vinschen DOT de> <20010716115100 DOT A87766 AT enteract DOT com> <20010716191553 DOT C25442 AT cygbert DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010716191553.C25442@cygbert.vinschen.de>; from cygwin@cygwin.com on Mon, Jul 16, 2001 at 07:15:53PM +0200

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 AT OntoSys DOT 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/

- Raw text -


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