Can you tell that dusk is my favourite time of day for photography?
Archive for February, 2010
Clifton Suspension Bridge
Tuesday, February 16th, 2010Solution to “No such file or directory: Couldn’t initialize cross-process lock in child” in Apache 2.2.13 on FreeBSD 8.0
Friday, February 12th, 2010This issue in the Apache error log was causing the web server to “partially crash” during a graceful restart with the following errors:
[Tue Feb 09 18:24:52 2010] [emerg] (2)No such file or directory: Couldn't initialize cross-process lock in child (/etc/opt/HybridCluster/apache2/logs/accept.lock.82760) (5)
[Tue Feb 09 18:24:52 2010] [notice] Apache/2.2.13 (FreeBSD) PHP/5.2.11 with Suhosin-Patch mod_ssl/2.2.13 OpenSSL/0.9.8k configured -- resuming normal operations
[Tue Feb 09 18:24:52 2010] [alert] Child 85206 returned a Fatal error... Apache is exiting!
Previously reported here, this issue occurs when hammering Apache simultaneously with requests and graceful restarts. Sometimes it would take several hours for the problem to manifest. The consequence is that Apache gets stuck with only two worker processes, meaning that requests succeed but very slowly — as they get queued — when under any load. Insidious! The solution was to change the type of locking Apache was using in httpd.conf:
AcceptMutex fcntl
This is a problem on FreeBSD 8.0 with Apache 2.2.13 using the prefork MPM, with the default UFS2 filesystem for the locks directory.
I hope someone finds this useful!


