Friday, March 10, 2006

IPCS remove semaphores

If you get an error message saying
"HTTPD dead but PID exists", your disk space is either full or all IPCS semaphores have been used up.

ipcs -s | awk ' $3 == "apache" {print $2, $3}' | awk '{ print $1}' | while read i; do ipcrm sem $i; done


Clean up ipcs semaphores

2 comments:

Ed said...

Thank you very much ... You are the only one that I found with this information after fruitlessly searching google for about 2 hours!

I also found a slight mod of your one liner to be useful to remove segments in general:
ipcs -m | awk ' $3 == "some_id" {print $2, $3}' | awk '{ print $1}' | while read i; do ipcrm -m $i; done

Anonymous said...

for semid in `ipcs -s | grep nobody | cut -f2 -d" "`; do ipcrm -s $semid; done


This is the best way to do what you are saying