ABHIONLINUX
Site useful for linux administration and web hosting

Showing posts with label unable to start apache. Show all posts
Showing posts with label unable to start apache. Show all posts

2010/01/20

Unable to start apache " pid file /usr/local/apache/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run? semget: No space left on device"

If you are unable to start apache and you are getting the error log as
[Sat Oct 10 00:11:01 2008] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run?
semget: No space left on device
 
It means There is no more space left in Semaphore Arrays for Apache.
semaphore is a location in memory whose value can be tested and set by more than one process.
you can check the semaphore arrays on your server using the following command

ipcs -s

It results

------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 360448 nobody 600 1
0x00000000 393217 nobody 600 1
0x00000000 425986 nobody 600 1
0x00000000 458755 nobody 600 1
0x00000000 524292 nobody 600 1
0x00000000 1114117 nobody 600 1
0x00000000 1441798 nobody 600 1
0x00000000 3604487 nobody 600 1
0x00000000 3702792 nobody 600 1
0x00000000 3768329 nobody 600 1
0x00000000 6422538 nobody 600 1
0x00000000 7077899 nobody 600 1

If here you get big list of semaphores it means some semaphores are stuck. You can clear them out with this command:

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

 Restart apache
#/etc/init.d/httpd restart