OT: korn/unix question, for gurus, semaphores |
|
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG.
This site is not affiliated with Porsche in any way. Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners. |
|
OT: korn/unix question, for gurus, semaphores |
tat2dphreak |
Feb 23 2007, 02:00 PM
Post
#1
|
stoya, stoya, stoya Group: Benefactors Posts: 8,797 Joined: 6-June 03 From: Wylie, TX Member No.: 792 Region Association: Southwest Region |
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 |
Feb 23 2007, 05:30 PM
Post
#2
|
Turbo Megasquirted Subaru Member Group: Members Posts: 2,827 Joined: 7-April 03 From: San Francisco, CA Member No.: 530 Region Association: Northern California |
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. |
Lo-Fi Version | Time is now: 26th May 2024 - 08:54 AM |
All rights reserved 914World.com © since 2002 |
914World.com is the fastest growing online 914 community! We have it all, classifieds, events, forums, vendors, parts, autocross, racing, technical articles, events calendar, newsletter, restoration, gallery, archives, history and more for your Porsche 914 ... |