1

Recently we are facing some issue in which we are running out of semaphores every now and then so for debugging i have used following commands to identify acquired semaphore is related to which process

ipcs -s|grep <username>

Above command will give me semaphores related to my unix id. After that i executed below command to get which process is related to semaphore :

ipcs -s -i <semid>

This will give output as :

semnum value ncount zount pid
0       0    0      0     28438

But the pid(28438) that it is returning is not associated with any running process. So my question is Is there any way to identify semaphore is related to which process (actual executable name) even though process is not running now ?

PapaDiHatti
  • 1,841
  • 19
  • 26
  • can u post the screenshot of that output ? – Coding Ninja Jun 30 '16 at 06:23
  • Actually that is on prod server and on that system we don't have internet access.However if you are looking for anything specific i can share that – PapaDiHatti Jun 30 '16 at 07:06
  • thats ok...can you please mention that error line (where `PID` which is not linked to any process is getting printed) in detail? I will just see if I can help with that. – Coding Ninja Jun 30 '16 at 07:13
  • edited question for better understanding – PapaDiHatti Jun 30 '16 at 07:19
  • No. There is no way to link semid to the process name once the process is dead. Did you check if its not a process and a thread. AFAIK the PID returned bu ipcs -i is usually 0 if the process is dead so I assume that the PID mentioned is actually a TID. – saai63 Aug 29 '20 at 17:52

0 Answers0