Help - Search - Members - Calendar
Full Version: OT: korn/unix question, for gurus
914World.com > The 914 Forums > 914World Garage
tat2dphreak
I am writing a ksh script to remove the semaphores not cleaned up by a unix program... problem is there's a lot of semphores on the box owned by the same users... so I need to seek out and find ONLY the 1 semaphore associated with the process... the process also creates a physical file to link to the semaphore in the tmp dir, if that helps.

is there a ksh version of C's semget functions?



maybe something extended with the ipcs command?

fiid
lsof can tell you what stuff a running process has... you might be able to use that - although it's not available on all unixes (although it can be installed).

If you use perl instead of ksh, you can probably use the semget functions. I generally recommend using a language like perl anyways since it's much easier to tell if you've made a coding mistake than it is in a shell script.

ipcs -p seems to list out semaphores and their owning processes, btw. "man ipcs" will tell you more on what facilities are available.



This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.