I recently encountered an issue with Apache where I had plenty of disk space free, but after running sudo service httpd restart I received the error:

Error: No space left on device

Running ipcs -s showed that after Apache stopped I was still holding active semaphores.

To Clean the semaphores I simply fixed with:

for i in ``ipcs -s | awk '/httpd/ {print $2}'``; do (ipcrm -s $i); done

Restart Apache and you should be good to go!