In apache 1.3 if you use a command as such: ErrorLog "|command >> filename" It will work, as there is an implicit passthrough to a shell. In 2.0.49, this behavior is still documented, but it doesn't appear to work. Replacing it with: ErrorLog "|/bin/sh -c \"command >> filename\"" does work. On looking at the code, it appears that there is an APR_SHELLCMD procattr, which must be set upon calling apr_create_proc if you want it to pass the child process through /bin/sh. This is not set in the code that opens the error log child process. I'm 100% certain that there is a bug - The question is whether it is in the documentation or in the core. I leave it to you to make that determination. Thanks. --Russell
Try the patch I'll attach in a sec.
Created attachment 11450 [details] run piped loggers via shell
Thanks. I will try this and get back to you when I have results. --Russell
*** Bug 16391 has been marked as a duplicate of this bug. ***
This is now resolved in httpd 2.1-dev. There are two issues w.r.t. putting the fix in 2.0.next: (a) there are some NetWare problems to resolve with changing the way piped loggers are invoked (actively being worked on) (b) a new feature was added to APR to allow both i. starting piped loggers via the shell (fixing one 1.3 regression) ii. passing same environment variables to piped loggers (fixing another regression) we'll have to work out how to use the new APR feature when available and not use the new feature otherwise, as there is a desire to make Apache httpd 2.0.new work with the latest official APR 0.9.x release, not just the level of APR bundled with Apache httpd; maybe a new APR 0.9.x release will be distributed before we reach this point In the meantime, keep using the patch posted here.
Marking fixed since this feature is available in 2.2.x releases now.