Monday, October 15, 2012

No space left on device: mod_jk: could not create jk_log_lock


I got this error while working on Apache.
[crit] (28)No space left on device: mod_jk: could not create jk_log_lock
Configuration Failed

It was due to the semaphore limitation.
[root@host ~]# ipcs -su
------ Semaphore Status --------
used arrays = 127
allocated semaphores = 127

[root@host~]# ipcs -s
------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 4292608 nobody 600 1
0x00000000 4325377 nobody 600 1
0x00000000 4358146 nobody 600 1
0x00000000 4390915 nobody 600 1
0x00000000 4423684 nobody 600 1
0x00000000 4456453 nobody 600 1

Apache was running as nobody. In your case it may be as Apache itself.
I had to kill all the semaphores and restart Apache.
You can either kill one by one or use some script if a lot of semaphores are there.

To kill one by one:
[root@host~]# ipcrm -s

By script:
[root@host~]# for i in `ipcs -s | grep nobody | cut -d " " -f2`;do ipcrm -s $i; done
Now restart Apache. It should work.

Recommended Reading

1. Web Application Architecture: Principles, Protocols and Practices
2. The Accidental Administrator: Linux Server Step-by-Step Configuration Guide
3. Apache Tomcat 7
4. Run Your Own Web Server Using Linux & Apache
5. Professional Apache Tomcat 6 (WROX Professional Guides)
6. Web Server Administration (Web Warrior)

1 comment:

Be nice. That's all.