Home  |  Forums  |  914 Info  |  Blogs
 
914World.com - The fastest growing online 914 community!
 
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.
 

Welcome Guest ( Log In | Register )

> OT: korn/unix question, for gurus, semaphores
tat2dphreak
post 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?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies(1 - 1)
fiid
post 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.



User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th May 2024 - 08:54 AM