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

On a cPanel dedicated server, apache server failed to start. So, while checking the apache logs found this:
==> /usr/local/apache/logs/error_log <==

[Sat Dec 20 01:12:27 2008]
[notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)

[Sat Dec 20 01:12:27 2008]
[warn] pid file /usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Sat Dec 20 01:12:27 2008]
[emerg] (28)No space left on device: Couldn't create accept lock
Solution:
First of all make sure your server is not out of space. This can be checked with the command:
root# df –h
Now, to check how many semaphores are currently in use the command is:
root# ipcs -s
When the apache (httpd) is stopped, to kill the semaphores ID the command is:
root# ipcrm –s 
To kill all the semaphores ID , you can achieve this by doing it in a for loop, the command is:
root# for semid in `ipcs -s | grep nobody | cut -f2 -d" "`; do ipcrm -s $semid; done
Note: “nobody” is apache user.
Now start apache with the command:
root# service httpd restart
This has fixed the issue for us.

    0 comments: