Sunday, March 2, 2008

Apache Error: (28) No space left on device

Symptom: When dealing with mem-leaks in my mod_perl-apps I ran into a serious apache-problem. After a while apache could not be started but failed with strange errors like:
[emerg] (28)No space left on device: Couldn't create accept lock

or

[crit] (28)No space left on device: mod_rewrite: could not create
rewrite_log_lock Configuration Failed


Problem: There was definitely enough space on the device where the locks are stored, as df said. I tried to explicetely different Lockfiles using the LockFile- directive but this did not help. I also tried a non-default AcceptMutex (flock) which then solved the acceptlock-issue and ended in the rewrite_log_lock-issue.Only reboot of the system seemed to help out of the crisis, but this is undesirable and to be avoided at most costs, as it does not solve but shift the problem. Additionally, a lot of other services would have been affected by the downtime, too, so this was not a way to go.

Solution: There were myriads of semaphore-arrays left, owned by the apache user.

# ipcs -s | grep apache

Removing this semaphores immediately solved the problem.

# ipcs -s | grep apache | perl -e 'while () {
@a=split(/\s+/); print `ipcrm sem $a[1]`}'

tested with: apache 2.0.43, 2.0.45, 2.0.47

--
Source: http://www2.goldfisch.at/knowledge/224

No comments: