httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: Aha! The conditional logging beast rears its head again
Date Mon, 03 Nov 1997 21:16:01 GMT
Dean Gaudet wrote:
> 
> Just because users ask for a feature doesn't mean we have to implement it
> the way they ask for it.  You know my opinion on this topic.  For example,
> here we go, here's conditional logging for 1.3:
> 
>     TransferLog "| pidthing /path/to/pidfile grep -v 'do your best' >>/path/to/access_log"
> 
> And here's an easier way to rotate logs for 1.3 without doing a full
> server restar:
> 
>     TransferLog "| pidthing /path/to/pidfile cat >>/path/to/access_log"
> 
> Where pidthing is the following sh script:
> 
>     #!/bin/sh
>     if [ $# -lt 2 ]; then
>         echo "usage: $0 pidfile_path program_to_exec [args ...]" 1>&2
>         exit 1
>     fi
>     if ! echo $$ > $1; then
>         echo "can't write pidfile" 1>&2
>         exit 1
>     fi
>     shift
>     exec ${1+"$@"}
>     echo "exec failed" 1>&2
>     exit 1
> 
> Impressive, no?  The unix philosophy at its best.

So impressive I don't understand it :-)

Actually, I presume the idea is you kill the cat from time to time?
Perhaps the script should be called "schroedinger"? :-)

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Mime
View raw message