Semaphore Arrays

Semaphore, it is a lot like a locking mechanism. In any server there is an order of precedence in which tasks must be accomplished. The semaphore is used to maintain that precedence order; more to the point, the precedence order is maintained by the semaphores. A succeeding task may not start until it has received the semaphores from all of it’s predecessors. Likewise  child processes of services gets killed or removed before it passes information to its succeeding processes. So it leads them to a hung state because of this incomplete transaction. This will result to failure of these services until we remove the Sem-ids manually from their arrays. Given below is a  small script to remove these arrays:-

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

There will be situations when Apache will fail because of the above reason , so you will need to just execute the above piece of code and restart Apache.

Share and Enjoy:
  • Digg
  • Mixx
  • del.icio.us
  • StumbleUpon
  • Facebook
  • TwitThis
  • Technorati
  • Google

Tags:

One Response to “Semaphore Arrays”

  1. forex Says:

    When I stumble upon a really great post I go ahead and do three things:1.Share it with all the close contacts.2.keep it in some of the common social sharing websites.3.Be sure to return to the blog where I first read the post.After reading this post I am really thinking of going ahead and doing all three…

Leave a Reply