On Tuesday 16 February 2010, minf...@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.

Reply via email to