|
Fix for when Apache won't start: semget: No space left on device
|
|
|
|
|
Written by wunk
|
|
|
|
Sunday, 29 April 2007
Some daemons can pop up with the following error (apache is one of them)
semget: No space left on device
This doesn' have anything to do with a full disk, but the system cannot allocate any more semaphores. This error tends to pop up if apache is stopped with kill -9 too much, it won't free the semaphores then. To free them up become root and issue the following command:
$ su - # for ID in `ipcs -s | grep '<user>' | awk '{print $2}'`; do ipcrm -s $ID; done
<user> must be replaced by the user under which apache runs, when it runs as httpd for example:
$ su - # for ID in `ipcs -s | grep 'httpd' | awk '{print $2}'`; do ipcrm -s $ID; done
What happens:
ipcs -s : lists all allocated semaphores
grep '<user>' : only shows that user
awk '{print $2}' : Cuts the list and only leaves the semaphore ID ipcrm -s $ID : Deletes the semaphore ID
|