问题:Apache无法启动,查看日志记录如下,检查磁盘空间以及inode都正常


[Tue May 20 18:10:48 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

[Tue May 20 18:10:48 2014] [warn] module wsgi_module is already loaded, skipping

[Tue May 20 18:10:48 2014] [warn] module wsgi_module is already loaded, skipping

[Tue May 20 18:10:48 2014] [notice] Digest: generating secret for digest authentication ...

[Tue May 20 18:10:48 2014] [notice] Digest: done

[Tue May 20 18:10:48 2014] [notice] mod_python: Creating 8 session mutexes based on 256 max processes and 0 max threads.

[Tue May 20 18:10:48 2014] [notice] mod_python: using mutex_directory /tmp 

[Tue May 20 18:10:49 2014] [emerg] (28)No space left on device: Couldn't create accept lock (/etc/httpd/logs/accept.lock.4485) (5)



原因:

Semaphore Arrays已满,下面是查到的相关解释


What the heck is a semaphore? Well, it’s actually an apparatus for conveying information by means of visual signals.

 But, when it comes to programming, semaphores are used for communicating between the active processes of a certain application.

 In the case of Apache, they’re used to communicate between the parent and child processes. If Apache can’t write these things down, then it can’t communicate properly with all of the processes it starts.



解决办法:

for i in `ipcs -s | grep apache| awk '{print $2}'`; do ipcrm -s $i; done



可以通过调整内核增加该值

kernel.msgmni = 1024

kernel.sem = 250 256000 32 1024