Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Make perl script to wait while external process is finish

by salva (Monsignor)
on Nov 17, 2011 at 09:28 UTC ( #938560=note: print w/ replies, xml ) Need Help??


in reply to Make perl script to wait while external process is finish

Has the java process been launched from the Perl script or externally? Because you can not wait using waitpid for a process that is not your child.

If it is an external process, your best option will probably be to use some lock over a file that is also locked by the Java process (or a wrapper) while it runs.

Alternatively, you can check if it is alive looking on the process table (see Proc::ProccessTable for instance) or if it runs as the same user as the Perl script with kill 0, $pid (see kill).


Comment on Re: Make perl script to wait while external process is finish
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-07-30 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls