I installed cacti about two weeks ago. Recently I was removing some virtual hosts from my httpd.conf file and then restarted apache. I was surprised when I received the following error:
Ouch! ap_mm_create(1048576, "/var/run/httpd.mm.27323") failed
Error: MM: mm:core: failed to acquire semaphore (No space left on device): OS: Invalid argument
Anyway, after running the error through Google, I discovered the "ipcs" command and how to determine what was using up the semaphores:
tux:~$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
------ Semaphore Arrays --------
key semid owner perms nsems status
0x00000000 1028 getreg 600 1
0x00000000 1029 getreg 600 1
0x00000000 1030 getreg 600 1
0x00000000 1031 getreg 600 1
//-- snipped the other 500 lines --//
(there was over 500 lines for the getreg user)
The user "getreg" is the user that the cacti cron job runs under. I then used a little script to free up the semaphores:
#!/bin/sh
ipcs | egrep getreg | awk '{print $2}' | xargs -n1 ipcrm sem;
ipcs | egrep getreg | awk '{print $1}' | xargs -n1 ipcrm sem
After that, apache starts up again just fine. Very quickly though, all of the semaphores are again used up.
Does anyone have any ideas on how to remedy this?? I have searched the net high and low for possible configurations problems, but there just isn't much info available.
Thanks!