Apache Error: No space left on device

Apache Error: No space left on device

problem:
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

solution:
we should clear semaphores

1. check note (user can be www-data )
ipcs -s | grep apache
2. remove
ipcs -s | grep apache | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'

3/etc/init.d/apache2 start (tested on ubuntu 10)