delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/16/13:31:08

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
Date: Mon, 16 Jul 2001 19:15:53 +0200
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] Updated: cygrunsrv-0.94-1
Message-ID: <20010716191553.C25442@cygbert.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT 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>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010716115100.A87766@enteract.com>; from fred@ontosys.com on Mon, Jul 16, 2001 at 11:51:00AM -0500

On Mon, Jul 16, 2001 at 11:51:00AM -0500, Fred Yankowski wrote:
> On Mon, Jul 16, 2001 at 06:27:27PM +0200, Corinna Vinschen wrote:
> > For example when changing the runlevel on a Linux system is requested,
> > init(8) sends a SIGTERM to processes which aren't defined on the new
> > runlevel. Which is a similar situation, IMO. Perhaps changing Cygwin
> > from sending SIGHUP to sending SIGTERM makes any sense?
> 
> Sending SIGTERM rather than SIGHUP does seem more appropriate for this
> case in general.  However, it might not work well for PostgreSQL.
> [...]
> 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.

5 seconds... that's not too much either.

> Cygrunsrv's --shutdown option gives us a limited capability similar to
> those init.d scripts, but unfortunately doesn't get the same priority
> in time that the scripts get.

According to MSDN we have some more time per service:

	By default, a service has approximately 20 seconds to perform
	cleanup tasks before the system shuts down. 

and it can be longer by changing the services behaviour:

	If the service needs more time to clean up, it sends
	STOP_PENDING status messages, along with a wait hint, so
	the service controller knows how long to wait before
	reporting to the system that service shutdown is complete. 

with the exception:

	However, there is a limit to how long the service controller
	will wait, to prevent a service from stopping shutdown. To
	change this time limit, modify the WaitToKillServiceTimeout
	value in the following registry key: 

	HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

We could even add an option to cygrunsrv which adds the feature to send
STOP_PENDING status messages every 5 seconds or so while the depending
service application performs it's cleanup.

Corinna

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

--
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