On 17 Feb 2010, at 8:54 PM, Jeff Trawick wrote:
The daemon-report-pidfile-error situation seems to be easily handled just by reversing the order of the apr_proc_detach block with the if-pidfile block. Then the unusable pidfile path error could be reported to the console in conjunction with -d just like a bogus cache path or such errors (which are already fatal).
In the process you end up logging the pid of the parent process, the process doomed to exit on daemonisation, and not the child process, which is the pid you want to keep track of.
One option is to open the file before the daemonisation, and write the pid file after the daemonisation, assuming this kind of thing is portable, I don't know.
Fix both? Although httpd has left dangling pid files in weird failure scenarios for a long time, I wouldn't consider it a feature, so yeah. At the same time? irrelevant as far as I'm concerned
When I said "at the same time", I meant "fix both now, rather than one now, and the other later (aka never)". I didn't necessarily mean simultaneously :)
Regards, Graham --
