You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/09/12 15:48:59 UTC

Questionable bug in SIGTERM handling.. (fwd)


---------- Forwarded message ----------
Date: Thu, 11 Sep 1997 18:53:41 +0100 (BST)
From: Jules Bean <jm...@hermes.cam.ac.uk>
To: apache-bugs@apache.org
Subject: Questionable bug in SIGTERM handling..

The way apache (1.2.4) handles SIGTERM handling is questionable....

I understand it SIGKILL the child web servers, to ensure a quick exit, but
the problem is that it SIGKILLs all its children... including, for
example, any program spawned as a log pipe.  This program then can't catch
the signal to flush its buffer, leaving broken log files.

Incidentally SIGUSR1 also doesn't work with a piped child process for log
files (but then again, you probably knew that, since it is documented as
being broken).

Regards,

Julian Bean
Jellybean Consulting

/----------------+-------------------------------+---------------------\
|  Jelibean aka  | jules@jellybean.co.uk         |  6 Evelyn Rd	       |
|  Jules aka     |                               |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@hermes.cam.ac.uk        |  TW9 2TF *UK*       |
+----------------+-------------------------------+---------------------+
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |
\----------------------------------------------------------------------/



Re: Questionable bug in SIGTERM handling.. (fwd)

Posted by Dean Gaudet <dg...@arctic.org>.
One possible workaround in 1.2 would be to have your log child do
something like:

    if (fork()) exit (0);

Which makes it spawn a second child that won't be killed by apache... err well
you probably have to set your process group too.  But that's the idea
anyhow.

Dean

On Fri, 12 Sep 1997, Alexei Kosut wrote:

> On Fri, 12 Sep 1997, Jules Bean wrote:
> 
> > The way apache (1.2.4) handles SIGTERM handling is questionable....
> > 
> > I understand it SIGKILL the child web servers, to ensure a quick exit, but
> > the problem is that it SIGKILLs all its children... including, for
> > example, any program spawned as a log pipe.  This program then can't catch
> > the signal to flush its buffer, leaving broken log files.
> 
> Yes, this is a known problem with Apache 1.2. It has been fixed in the
> 1.3 development tree, and Apache 1.3b1 (due out shortly) should correctly
> send a SIGTERM to the Apache children, and clean up and exit gracefully.
> 
> Thanks for using Apache!
> 
> -- Alexei Kosut <ak...@organic.com>
> 
> 


Re: Questionable bug in SIGTERM handling.. (fwd)

Posted by Alexei Kosut <ak...@organic.com>.
On Fri, 12 Sep 1997, Jules Bean wrote:

> The way apache (1.2.4) handles SIGTERM handling is questionable....
> 
> I understand it SIGKILL the child web servers, to ensure a quick exit, but
> the problem is that it SIGKILLs all its children... including, for
> example, any program spawned as a log pipe.  This program then can't catch
> the signal to flush its buffer, leaving broken log files.

Yes, this is a known problem with Apache 1.2. It has been fixed in the
1.3 development tree, and Apache 1.3b1 (due out shortly) should correctly
send a SIGTERM to the Apache children, and clean up and exit gracefully.

Thanks for using Apache!

-- Alexei Kosut <ak...@organic.com>