clean up semaphores and shared memory by process ID on Redhat OS

book

Article ID: 40140

calendar_today

Updated On:

Products

CA Single Sign On Secure Proxy Server (SiteMinder) AXIOMATICS POLICY SERVER CA Single Sign On SOA Security Manager (SiteMinder) CA Single Sign-On

Issue/Introduction

Issue/Problem/Symptoms: 

In most of the cases ,a custom Stop / Start scripts are used to restart the web servers with Siteminder Agents (Apache ,Iplanet ,IBM HTTP server ...) . 

Some of these shutdown scripts uses the Kill -9 to terminate the LLAWP process in case it took longer then expected to shutdown.

The sempahores and shared memory must be cleaned up for the LLAWP process if kill -9 before starting the Web server and fork a new LLAWP .

This can be tricky if you have multiple Virtual Hosts configured with the agent as you will need to determine what semaphores / Shared memory to clean up that is linked to the LLAWP process in question.

Environment:

Applicable on REDHAT OS only

Cause: 

N/A

Resolution/Workaround:

Below is how to correlate the LLAWP PID to the created semaphores and shared memory.

  • Semaphore Cleanup
    1. run "ipcs -s" to get all semid for the User apache in your case that still exists
    2. for each semid returned ,you can run "ipcs -s -i "  for example --> ipcs -s -i 4587567 that will give you the PID that the semaphore is attached to .If this matches the LLAWP Process ID ,Then you can proceed removing it 

semnum value ncount zcount pid

0       0     4      0     1957

            3. ipcrm -s semid 

 

  • Shared Memory cleanup
    1. run ipcs -p .This will show you the shared memory attached to the process .
    2. peform an ipcrm -m shmeid to remove it 

 

Additional Information:

N/A

 

Environment

Release:
Component: SMAPC