我在我的Web服务器上看到一个反复出现的问题:
[Sun May 16 03:10:19 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Sun May 16 04:10:05 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Sun May 16 05:10:04 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Sun May 16 05:17:13 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed
到目前为止,我遇到的唯一问题是重启我的服务器。 这是不理想的: – \
重新启动httpd不会清除错误。 df表示我有20 +演出免费, top和免费两个报告800 + megs(或1.2演出)
> df -h Filesystem Size Used Avail Use% Mounted on /dev/simfs 40G 18G 23G 44% / # > free total used free shared buffers cached Mem: 1474560 300832 1173728 0 0 0 -/+ buffers/cache: 300832 1173728
任何想法,为什么会发生,以及如何防止/修复它?
http://devtime.blogspot.com/2008/02/apache-error-no-space-left-on-device.html
Apache错误:设备上没有剩余空间
Apache不启动,错误日志包含:
[emerg] (28)No space left on device: Couldn't create accept lock
要么
[crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed
检查你的磁盘后,显示你有足够的空间。 问题是,Apache没有正常closures,并留下了无数信号量数组,由“Apache”用户拥有。
跑:
ipcs -s | grep apache
马上删除这些信号应该解决这个问题,并允许Apache启动。
ipcs -s | grep apache | perl -e 'while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
其中apache是apache进程的所有者,如果这不是你的服务器上的用户的名称改变它。
用awk更简单一些:
for id in $(ipcs -s | grep 'apache'| awk '{ print $2 }'); do ipcrm sem $id; done
那个xargs似乎不适合我,所以在bash中,我做了这个:
对于ipcs -s | grep apache | cut -b11-22 x ipcs -s | grep apache | cut -b11-22 ipcs -s | grep apache | cut -b11-22 ; 做ipcrm -s $ x; DONE