This is a discussion on semaphores and PID within the Linux Administration forums, part of the Linux Forums category; Hello, I have a problem with a semaphores. It is look like some processes use semaphores, but after they die, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I have a problem with a semaphores. It is look like some processes use semaphores, but after they die, they don't return semaphores back to the system. When I checked semaphores with ipcs -s, I noticed that mostly of them are in use by user root (184 out of 190). I would like to find which process cause the problem, so I would like to get the information, which process (PID) use the semaphore. How can I do that. If I use ipcs -s -p I got nothing. It is look like switch -p doesn't work for semaphores, only for shared memory. I'm using RedHat Advanced Server 2.1. Is there any idea, how can I determine PID whcih use semaphore? Regards, Lovro |
|
|||
|
"Lovro VREŠ" <lovro@kopa.si> writes:
>Hello, > >I have a problem with a semaphores. It is look like some processes use >semaphores, but after they die, they don't return semaphores back to the >system. None of the system V IPC resources (message queues, semaphores and shared memory segments) are automatically returned upon process exit (quite simply because they, by definition, are used by more than a single process). The process must explicitly call semctl(,,ICP_RMID,) to remove the semaphore when it is no longer needed. The ipcrm command can be used to clean up after poorly written code or in cases where it is not feasible for the application itself to remove the semaphore. >I would like to find which process cause the problem, so I would like to get >the information, which process (PID) use the semaphore. How can I do that. If ipcs(1) doesn't give you the information, you'll probably have to start poking around in the kernel. Using kdb <http://oss.sgi.com/projects/kdb> may be of some help. If you don't feel comfortable with kdb (for which you'll need to build a kernel), you'll have to disable all your services, reboot, then enable and start them one at a time checking ipcs(1) between each one, until you find the guilty culprit. scott |
![]() |
| Thread Tools | |
| Display Modes | |
|
|