Mail Archives: cygwin/2001/07/16/13:31:08
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 -