Best way to clear Locked Apache Semaphores with ipcrm?
We tried restarting apache earlier today, and our semaphores were all locked up. So I ran the following command:
Code:
for i in 'ipcs -s | grep nobody | awk '{print $2}'` do ipcrm sem $i done Then I ran the script that our server support has run in the past when semaphores locked up: Code:
ipcs -s | grep nobody | perl -e 'while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}' Code:
deprecated usage: ipcrm {shm | msg | sem} id ... So I have a few questions... 1) Is it safe to run ipcrm while apache is running? 2) Why is my hosting support using a deprecated script, and why did that seem to work anyway (although when I run ipcs -s | grep nobody, it seems that a ton of semaphores exist)? In the past, we have always called our hosting company for support when this issue has arisen. But I feel more comfortable, I think, than the others in the office to do more and more of our server admin stuff. Since I've been here (for about 6 months now), I've started researching things that we can do on our own. Anyway, in the past when they run the script above, I will run Code:
ipcs -s | grep nobody Today, after running both scripts above, I run ipcs -s | grep nobody, and I still see quite a few semaphores. Perhaps I didn't give the first script long enough to run, and that some of the semaphores were deleted, and that script is actually the one that fixed things? Any ideas, comments, or solutions? Thanks, David |
Quote:
Code:
for i in $(ipcs -s | grep nobody | awk '{print $2}'); do ipcrm sem $i; done Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
That was very helpful. Thank you.
We haven't been very pleased with our hosting company, and we are getting ready to purchase our own hardware. So knowing these things is good anyway. Based on your answer, it seems to me that you're saying NONE of the semaphores were never cleared. So my question is, why was I able to start Apache after running these two scripts? |
Quote:
|
All times are GMT -5. The time now is 06:41 AM. |