FIX:- (28)No space left on device: Couldn’t create accept lock

Sometime Apache (HTTPD) service on a Server stops and while restart it shows following messages in error_logs

[Wed Sep 17 00:28:23 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Wed Sep 17 00:28:23 2008] [crit] (28)No space left on device: mod_rewrite: Parent could not create RewriteLock file /usr/local/apache/logs/rewrite_lock
Configuration Failed

Such errors appears when you are running out of Disk Space or Quota which is assigned (which can be increased to fix the issue) OR when semaphores of the server gets full. Semaphores are often used to restrict the number of threads than can access some (physical or logical) resource. Following command can be used to see the Semaphores list

ipcs -s | grep apache
ipcs -s | grep nobody
ipcs -s | grep [webuser]

To destroy/delete all semaphores, you can use follwong script which you can directly execute on the Shell

for i in `ipcs -s | grep apache | awk '{print $2}'` do ipcrm sem $i done
for i in `ipcs -s | grep nobody | awk '{print $2}'` do ipcrm sem $i done
for i in `ipcs -s | grep [webuser] | awk '{print $2}'` do ipcrm sem $i done 

Try to restart apache now. The above tweak will fix the issue temporarily as it will re-occur when Semaphores get full. You can add following lines in “/etc/sysctl.conf” to get this issue fixed permanently. These values will increase the limits of Semaphores on the Server.

kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024

After you save “/etc/sysctl.conf” run “sysctl -p” to reload the sysctl.conf file.

About: Mike

Milind Koyande loves to work on new technologies specially virtualization and troubleshoot server problems. I’m an avid photographer and love to spend my free time close to nature, trying to capture its glory on my camera.

This site uses Akismet to reduce spam. Learn how your comment data is processed.