semget: No space left on device

Whenever you start Apache, it keeps crashing with error “semget: No space left on device”.

Apacha error_log shows:

# tail /etc/httpd/logs/error_log
semget: No space left on device
semget: No space left on device
[Wed Sep 12 10:54:27 2007] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten
-- Unclean shutdown of previous Apache run? semget: No space left on device
[Wed Sep 12 10:56:27 2007] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten
-- Unclean shutdown of previous Apache run? semget: No space left on device
[Wed Sep 12 10:58:27 2007] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten
-- Unclean shutdown of previous Apache run? semget: No space left on device
[Wed Sep 12 11:00:27 2007] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten
-- Unclean shutdown of previous Apache run? semget: No space left on device

If you have similar problem as mine above [b]+[/b] if your disk space is nowhere near/above 100% [b]+[/b] /var/messages and /usr/local/apache/logs/error_log shows no clue about this problem [b]+[/b] any files in /etc/httpd/logs/ and /etc/httpd/domlogs nowhere near/above 2GB in size, its most probably semaphore problem. Use the following script to cure your Apache.

#!/bin/bash

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

/scripts/restartsrv httpd

Script how to:
– SSH as root to your CPanel server
– Go to root dir
# cd /root
– Create a httpdsemclean.sh blank file
# pico httpdsemclean.sh
– Write above script
– Save
Ctrl + O
– Exit pico
Ctrl + X
– Chmod httpdsemclean.sh to 777
# chmod 777 httpdsemclean.sh
– Execute the script
./httpdsemclean.sh

If all goes fine, you’ll see something like this:
...
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
resource(s) deleted
Waiting for httpd to restart..............finished.

httpd started ok

PS: Do this at your own risk, we do not guarantee this will work on all CPanel servers!

Tagged with 
About sepedatua
I am nothing special, of this I am sure. I am a common man with common thoughts and I’ve led a common life. There are no monuments dedicated to me and my name will soon be forgotten, but I’ve loved another with all my heart and soul, and to me, this has always been enough.

Leave a Reply