httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WC -Sx- Jones <>
Subject Re: [users@httpd] Piped Log Rotation
Date Mon, 19 May 2003 22:57:56 GMT

On Monday, May 19, 2003, at 04:14  PM, wrote:
> Second question is this. If the web admin botches the args for this 
> program, I'd like to kill the HTTPD process so that they know right 
> away
> that there's a problem (rather then just sending a message to STDERR 
> which
> is going to go unnoticed into the error log unless they check right 
> away).
> Since there is an intermediate shell process in between my program and 
> the
> parent httpd process, I can't simply kill my parent to kill the web 
> server.
> Is it safe instead to get the Process Group ID and send a kill to it?
> (getpgrp()) This is written specifically for UNIX environments 
> (solaris and
> aix), not Wintel.

Then the answer requires it to be addressed with a Unix/Apache answer 
-- see the apachectl script for hints...

An stripped example -

# Copyright (c) 2000-2002 The Apache Software Foundation.

# the path to your httpd binary, including options if necessary

# pick up any necessary environment variables
if test -f /usr/local/apache/bin/envvars; then
   . /usr/local/apache/bin/envvars

ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"

# Set the maximum number of file descriptors allowed per child process.
if [ "x$ULIMIT_MAX_FILES" != "x" ] ; then

$HTTPD -k stop
exit $ERROR

###########  End of Script

HTH/Sx =)
  ('>    iudicium ferat
  //\   Have Computer -
  v_/_    Will Hack...

               \|/ ____ \|/
               "@'/ .. \`@"
               /_| \__/ |_\

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message