JasonDaly.name

PHP, Ruby, Symfony, Rails, Doctrine, MooTools. Web Development.

Posts tagged with "semaphore"

March 25, 2009

Clear Hanging Apache Semaphores

Restarting httpd while trying to alleviate high load on one of the servers I manage, I was recently presented with the following error

(28)No space left on device: Couldn't create accept lock

After some research I found running the following command1

ipcs -s

showed there were a bunch of semaphores hanging around even though apache had been stopped normally via

service httpd restart

Similar to the code snippet mentioned by Major over at RackerHacker, the following command clears out those semaphores, letting httpd start up without a problem

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

1 note Tags: bash apache linux ipcs httpd load semaphore linux