httpd dead but subsys locked
把/var/lock/subsys/下的httpd删除重启httpd服务也不行,查看/var/log/httpd/error_log发现错误如下
:No space left on device:Couldn't create accept lock
1.首先确定你的磁盘空间是否真的不足或者已经达到配额;
semaphore是一个内部用于与其子进程进行交流的工具,"
Couldn't create accept lock
用如下命令查看有多少
#ipcs -s
key
0x00000000 68681743 apache 600
0x00000000 68714515 apache 600
0x00000000 68747291 apache 600
你可运行如下命令来安全的杀死每个
#ipcrm -s
是上面ipcs -s输出的第二列值。
想要一次性将所有的Semaphore全部杀死,请运行如下命令:
for semid in `ipcs -s |awk '{print $2}'`; do ip
如果不能再创建更多的Semaphores:
有些时候你可能想改变系统允许创建
如果你在虚拟机上运行而不能改变内核参数,请联系你的主机提供商来改变这个参数。
运行以下命令来查看当前参数:
#ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 1024
max semaphores per array = 250
max semaphores system wide = 256000
max ops per semop call = 32
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 1024
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384
修改
kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024
运行命令# sysctl -p
使刚改的参数生效。
(kernel.msgmni
另外延伸到/var/lock/subsys作用
/etc/rc.d/init.d[root@rrd init.d]# cat syslog
#!/bin/sh
#
# syslog
#
#
# chkconfig: 2345 30 99
# description: Syslog is the facility by which many daemons use to log \
# messages to various system log files.
# run syslog.
# securlevel: 90
# processname: syslogd klogd# Source function library.
. /etc/rc.d/init.d/functions[ -f /sbin/syslogd ] || exit 0
[ -f /sbin/klogd ] || exit 0if [ -f /etc/sysconfig/syslog ]
then
else
fiRETVAL=0# See how we were called.
case "$1" in
esacexit $RETVAL# cd /var/lock/subsys/
# ll syslog
-rw-r--r--