Friday, February 08, 2008

Apache Error: No space left on device

Apache doesn't start and the error log contains:

[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

After checking your disk it shows that you have plenty of space. The problem is that apache didn't shut down properly, and it's left myriads of semaphore-arrays left, owned by 'apache' user.

Run:

ipcs -s | grep apache

Removing these semaphores immediately should solve the problem and allow apache to start.

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


where 'apache' is the owner of the apache process, if that's not the name of the user on your server change it.

4 comments:

Anonymous said...

deprecated usage: ipcrm {shm | msg | sem} id ...

use '-s' instead of 'sem'

Anonymous said...

I had to use while()

Anonymous said...

That didn't take
I had to use

while (<STDIN>)

Anonymous said...

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

did the job