Fix Apache – No space left on device: Couldn’t create accept lock

Tuesday, June 23rd, 2009

This issue is related to semaphores. To view how many semaphores you have use:

root@hal [~]# sysctl -a | egrep kernel.sem\|kernel.msgmni
kernel.sem = 250 32000 32 128
kernel.msgmni = 16

You can change this values by adding them in /etc/sysctl.conf and then using sysctl -p to activate them.
There is no need to reboot.

To remove sempahores use either one of these commands:

for i in `ipcs -s | grep nobody | awk ‘{print $2}’`; do ipcrm -s $i; done
/scripts/restartsrv_httpd

or in Perl

ipcs -s | grep nobody | perl -e ‘while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}’

or with xargs

ipcs -s | grep nobody | awk ‘ { print $2 } ‘ | xargs ipcrm

or bash style

for ipsemId in $(ipcs -s | grep nobody | cut -f 2 -d ‘ ‘); do ipcrm $ipsemId;done

Other errors :

Cannot create SSLMutex

add in httpd.conf

SSLMutex sem

Sysctl Linux

Saturday, June 13th, 2009
net.ipv4.tcp_ecn = 0
net.ipv4.conf.default.rp_filter = 1
#kernel.sysrq = 1
kernel.core_uses_pid = 1

net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.eth0.rp_filter = 0

net.ipv4.neigh.default.gc_thresh1 = 65535
net.ipv4.neigh.default.gc_thresh2 = 65535
net.ipv4.neigh.default.gc_thresh3 = 65535

kernel.core_uses_pid = 1
#Default ttl
net.ipv4.ip_default_ttl = 255

#No uptime
net.ipv4.tcp_timestamps=0

#Forwarding
net.ipv4.ip_forward = 1

net.ipv4.tcp_ecn = 0
net.ipv4.conf.default.rp_filter = 1
kernel.core_uses_pid = 1

#Connection max numer
net.ipv4.ip_conntrack_max = 65535

#Against DDOS //6169=0x1819
net.ipv4.icmp_ratelimit=0
net.ipv4.icmp_ratemask=6169

#Disabling of ICMP echo-reply directed to Broadcast addresses // against scanning
net.ipv4.icmp_echo_ignore_broadcasts=1