cPanel SERVER MANAGEMENT

Fix: [crit] (28) No space left on device: mod_jk: could not create jk_log_loc

No space left on device
No space left on device

This article helps you to Fix: “No space left on device” errors. This error can be found in the Apache error log. This issue is due to the Apache is running out of Semaphores. Semaphores are used for communicating between the active processes of a certain application.

Error:

Apache service won’t start.

[Mon Aug 24 09:50:21 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Mon Aug 24 09:50:21 2015] [crit] (28) No space left on device: mod_jk: could not create jk_log_lock Configuration Failed

Error log Path:

Apache error log.

cPanel: /usr/local/apache/logs/error_log
No control panel: /etc/httpd/logs/error_log

The cause of the issue:

This issue is due to the Apache is running out of Semaphores. Semaphores are used for communicating between the active processes of a certain application. In the case of Apache, Semaphores are used to communicate between the parent and child processes. Generally, Apache cleans up these things itself, but sometimes it can’t due to some semaphores are got stuck. Then it can’t communicate properly with the newly started processes. Hence, the Apache goes down.

Fix:

Use the below command to get the list of semaphores.

ipcs -s

You can find the Apache process is running as nobody or as Apache itself. The stale semaphores can clear using the following command.

for i in `ipcs -s | awk '/httpd/ {print }'`; do (ipcrm -s $i); done

Now you can restart the Apache service.

/etc/init.d/httpd restart

If it didn’t restart properly, you may need to increase the semaphore limit. You can check the current limit using the below command.

# cat /proc/sys/kernel/sem
250 32000 32 128

Increase those limits by adding the below line to /etc/sysctl.conf file.

kernel.sem = 500 64000 64 256

This changes will take the effect in next reboot. If you need to make the changes in immediate effect, run the below command.

sysctl -p

That’s it!

Also Read:

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com