You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Vladimir Egorov <ve...@bea.com> on 2007/06/05 19:46:02 UTC

Ant support for daemon processes

Hi Ant Users,

I am interested in Ant support for daemon processes, such as servers.
For example, I would like to stop an Exec or Java process on demand -
this is not possible with existing Exec and Java tasks.

Ant manual for parallel task has the following example that "represents
a typical pattern for testing a server application":

<parallel>
  <wlrun ... >
  <sequential>
    <sleep seconds="30"/>
    <junit ... >
    <wlstop/>
  </sequential>
</parallel>

Above <wlstop> is a proprietary task that only works with WL. I am
looking for a generic 'kill' task that can kill a referenced process.

The above example may look like this.

<parallel>
  <exec id='myserver'
    executable='ServerUnderTest.exe'
    ...
  <sequential>
    <sleep seconds="30"/>
    <junit ... >
    <kill id='myserver'/>
  </sequential>
</parallel>

Unlike the WL example, we are not using a proprietary stop mechanism.
The <kill> task is a generic task that calls Process.destroy(), and
works for both Exec and Java processes.

Is there anything in the Ant World on this?
    
Thank you,

--Vladimir

P.S. Another area is full support for 'spawn' attribute. Right now:

    $ ant -version
    Apache Ant version 1.6.5 compiled on June 2 2005
    $ cat t.xml
    <project>
      <exec executable="ls" spawn="true" timeout="1000"/>
    </project>
    $ ant -f t.xml
    Buildfile: t.xml
    spawn does not allow attributes related to input, output, error,
result
    spawn also does not allow timeout
    finally, spawn is not compatible with a nested I/O <redirector>
    
    BUILD FAILED



Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

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


Re: Ant support for daemon processes

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 5 Jun 2007, Vladimir Egorov <ve...@bea.com> wrote:

> The above example may look like this.
> 
> <parallel>
>   <exec id='myserver'
>     executable='ServerUnderTest.exe'
>     ...
>   <sequential>
>     <sleep seconds="30"/>
>     <junit ... >
>     <kill id='myserver'/>
>   </sequential>
> </parallel>
> 
> Unlike the WL example, we are not using a proprietary stop
> mechanism.  The <kill> task is a generic task that calls
> Process.destroy(), and works for both Exec and Java processes.
> 
> Is there anything in the Ant World on this?

No, I don't think there is, even though it shouldn't be too difficult
to implement.

> P.S. Another area is full support for 'spawn' attribute. Right now:
> 
>     $ ant -version
>     Apache Ant version 1.6.5 compiled on June 2 2005
>     $ cat t.xml
>     <project>
>       <exec executable="ls" spawn="true" timeout="1000"/>
>     </project>
>     $ ant -f t.xml
>     Buildfile: t.xml
>     spawn does not allow attributes related to input, output, error,
> result
>     spawn also does not allow timeout
>     finally, spawn is not compatible with a nested I/O <redirector>

This hasn't changed in 1.7.0 either.

When spawn is true, Ant just starts the Process and doesn't care for
it anymore.

Stefan

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