No space left on device: Couldn't create accept lock
上一篇 / 下一篇 2008-01-28 09:54:51 / 个人分类:linux系统管理
r k?:er;tl0[emerg] (28)No space left on device: Couldn't create accept lock刚开始还以为是空间不足,造成无法创建cgisock文件,但是df -h察看,发觉不是这个问题。求助于google,一下子就找到了原因。
VUa"Pak$~0使用:ipcs -s | grep nobodyIXPUB技术博客3z'eT$ml`@p#p
IXPUB技术博客X%GM v6P
9miI@9xS7E/Z9n;T0察看发觉有一堆ipc使用,需要干掉。这个可能的原因是程序所造成的。IXPUB技术博客&}2xQ*F/O'yJ7z{
&Cn}.Potl l5w0清除命令:IXPUB技术博客2p.m#i{ V]oT
ipcs -s | grep nobody | perl -e 'while (<STDIN>;) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
G"prw'YL0然后启动Apache即可。
8}$o-d+S2{O4c;@0IXPUB技术博客7FJ#KU3h.T
更深入的了解:IXPUB技术博客m?c)e.e6k]g0a
QX(QN ?tY0
Z%Q$ME1l G0
/c8E_3^W {kl0
Fixing Apache "No space left on device: Couldn't create accept lock" errors
A%UrC J9\0IXPUB技术博客%@;B6O5~"p{Error Message: When starting Apache, I get this error message in the main Apache error_log:IXPUB技术博客!^$cGix J
(D By*t2\4|$fbP0
[emerg] (28)No space left on device: Couldn't create accept lock
2?_A L8T0[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
)a\_HF7C,I{0[notice] Digest: generating secret for digest authentication ...
9`2t([G.`+L5r'j0[notice] Digest: done
!DM$k`%G;L0[warn] pid file /etc/httpd/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
B5T i9V0|],F0[emerg] (28)No space left on device: Couldn't create accept lock
,k/K+Y5y5C~0
First off, check to make sure that you really aren't out of disk space, or have hit a quota limit. Another way that Apache can create the "accept lock" is with a semaphore. A semaphore is an inter-process communication tool that is used by Apache to communicate with it's child processes. This error message may mean that Apache couldn't create a new semaphore.
S,C['JW"p1`00cw"iJpu5G0
Check to see how many semaphores are currently in use. If Apache is running correctly, you should see something like this:
2U"b/v%f,A_/oM0gc0LW\'xep0
# ipcs -sIXPUB技术博客
T&pCn-cM`_
------ Semaphore Arrays --------
{Z e!w'PU!k0key semid owner perms nsemsIXPUB技术博客8zyX_A0ay}%H
0x00000000 68681743 apache 600 1IXPUB技术博客IK.wN4k
U(h4A:?
0x00000000 68714515 apache 600 1IXPUB技术博客R$~C5}B$W.hQ
0x00000000 68747291 apache 600 1
If Apache is stopped, and you still see these semaphores, then you can safely kill them by running this command for each semaphore id (in the second column)
|?R-Y4F)J W3h01\K:q ^'U0
$ ipcrm -s <semid>
[ _^ HloE5K0DB1J5H&y'Z"p`l/R0
To destroy all semaphores, you can run this from the command line (with "apache" being the apache-user):
A\2vY)xO;uA0+l0R LFD)HOi)hg3E0
for semid in `ipcs -s | grep nobody | cut -f2 -d" "`;IXPUB技术博客a$tz,?y,u
IXPUB技术博客"zI6q.H!M?do ipcrm -s $semid; doneIXPUB技术博客G(j"Y-~m
O*E2L#k ^k0
]*{Q3~ ?3x
J
]0[这个地方可能需要改一下,我的apache是nobody启的,所以是grep nobodyIXPUB技术博客wz
w4FVT"G
IXPUB技术博客$R0{hhEY7s
IXPUB技术博客3Ks8v7o9W m LYkIf you are out of semaphoresIXPUB技术博客 P3Y#Q9U.O#\
IXPUB技术博客bS&l2H{4qIf you can't create any more semaphores:IXPUB技术博客#s7S.qqa.]YM
IXPUB技术博客+O6?v$Js I[Sometimes your system may need to increase the number of semaphores that are available on the system. This requires a change to a kernel parameter. If you are running on a virtual server and cannot modify kernel parameters, you may need to ask your hosting provider to change this parameter on their host server To view the current parameters:
#}$H n%fTqGMs7M0~ T#iL8K4fS0
# ipcs -lIXPUB技术博客C*m!DY*O
------ Shared Memory Limits --------
AUjfjR#kU0max number of segments = 4096
2sb[g1s0max seg size (kbytes) = 32768IXPUB技术博客otUY m8Zn9Z
max total shared memory (kbytes) = 8388608IXPUB技术博客C.edfV8?u _
min seg size (bytes) = 1IXPUB技术博客.En7Y"}}o8LV0]9Lk
IXPUB技术博客:y9h:njT {S
------ Semaphore Limits --------IXPUB技术博客1nZWn!U2z
~S
max number of arrays = 1024
KY)T2jF2@0max semaphores per array = 250
}VV+@7p0max semaphores system wide = 256000IXPUB技术博客,J$eu5p_@2QH9?
max ops per semop call = 32