You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Frederic CHALONS <fr...@hsoftware.com> on 2006/03/06 10:03:29 UTC

java/exec task - process tracking

Hi,

I am using a ant file to launch various processes.
Previously, this was done via a bash file via.

With bash, I could retrieve PIDs from $! variable to keep track of launched
processes.
How may I achieve something similar with Ant.
May I retrieve pid associated to an java/exec task?
So far, I am still using a minimal bash script to retrieve the PIDs after
invoking Ant.

Any other alternatives?
Any solutions supporting Windows too in addition to Unix/Linux systems?

Thank you,
--
Frederic CHALONS

Re: java/exec task - process tracking

Posted by Steve Loughran <st...@apache.org>.
Frederic CHALONS wrote:
> Hi,
> 
> I am using a ant file to launch various processes.
> Previously, this was done via a bash file via.
> 
> With bash, I could retrieve PIDs from $! variable to keep track of launched
> processes.
> How may I achieve something similar with Ant.
> May I retrieve pid associated to an java/exec task?
> So far, I am still using a minimal bash script to retrieve the PIDs after
> invoking Ant.

There's nothing in java pre-1.5 that even vaguely resembles a PID, so no 
way for ant to get at it.

> 
> Any other alternatives?
> Any solutions supporting Windows too in addition to Unix/Linux systems?

java1.5 has jps and jconsole; every ps can run with jmx management 
turned on if you fiddle with the parameters.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org