httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WC -Sx- Jones <li...@insecurity.org>
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, na11@daimlerchrysler.com wrote:
> Second question is this. If the web admin botches the args for this 
> PERL
> 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 -

#!/bin/sh
#
# Copyright (c) 2000-2002 The Apache Software Foundation.

# the path to your httpd binary, including options if necessary
HTTPD='/usr/local/apache/bin/httpd'

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

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
     $ULIMIT_MAX_FILES
fi

ERROR=0
$HTTPD -k stop
exit $ERROR

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

HTH/Sx =)

http://insecurity.org/
_Sx____________________
  ('>    iudicium ferat
  //\   Have Computer -
  v_/_    Will Hack...

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


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message