Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Ideas for implementing pShell

by elwarren (Priest)
on Apr 04, 2004 at 16:08 UTC ( [id://342481]=note: print w/replies, xml ) Need Help??


in reply to Ideas for implementing pShell

A good way to do this would be to borrow a page from unix add some simple lockfile methods to your code. Choose a common directory for your programs, maybe "c:\pvoice\lock\" When you launch a program it should create a file and possibly put it's process id inside. When the program exits, remove the file. When programs startup they should check for their respective lockfile and exit if its found. Need to kill or stop a process, open it's lockfile and use it's pid. If a process crashes then the lockfile will exist but the process id will not, the crash can be recorded and a new instance fired up.

This could be implemented in each of your programs without a requirment of the minimanager. This is how many unix programs manage use of the serial ports without having complex interprocess communications.

I'm sure there's some sort of module out there to do this already. Searches for either lockfile or process management on cpan should turn something up.

HTH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://342481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-19 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found