httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Re: svn commit: r910705 - in /httpd/httpd/trunk: CHANGES docs/manual/programs/htcacheclean.xml support/htcacheclean.c
Date Fri, 26 Feb 2010 10:00:35 GMT
On Tuesday 16 February 2010, minfrin@apache.org wrote:
> Author: minfrin
> Date: Tue Feb 16 21:42:03 2010
> New Revision: 910705
> 
> URL: http://svn.apache.org/viewvc?rev=910705&view=rev
> Log:
> support/htcacheclean: Teach it how to write a pid file (modelled on
> httpd's writing of a pid file) so that it becomes possible to run
> more than one instance of htcacheclean on the same machine.

...

> +    if (pidfile) {
> +        apr_file_t *file;
> +        pid_t mypid = getpid();
> +        if (APR_SUCCESS == (status = apr_file_open(&file, pidfile, APR_WRITE
> +                | APR_CREATE | APR_TRUNCATE,
> +                APR_UREAD | APR_UWRITE | APR_GREAD, pool))) {
> +            apr_file_printf(file, "%ld" APR_EOL_STR, (long) mypid);
> +            apr_file_close(file);

I think a world readable pid file would be better, to make monitoring easier.

Mime
View raw message