ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <ma...@sedonacorp.com>
Subject Re: Launch a separate process(terminal window) from Ant [Linux]
Date Tue, 07 Aug 2001 16:59:06 GMT
BlaineNewsletters(@yahoo) wrote:

>I'm trying to launch a separate process from Ant (call Weblogic's startup
>script, startWebLogic.sh) in a new window, and have the original window run
>in parallel.
>This is no problem within Win2000. I use the exec task to call "start" to
>launch a new window and give it the command line parameters for
>startWebLogic.cmd
>When trying to use the exec task for Linux, I can't accomplish the same
>thing. I've tried various different methods (xterm, sh) but without success.
>I can get a new terminal launched and weblogic runs, but the originating
>terminal waits for weblogic to complete before continuing.
>
>I haven't been able to figure out a way to correctly do this and I was
>hoping somebody else had. As a last resort, people have suggested I call
>"java" and then use "fork" to return control back to Ant.
>Any suggestions?
>----------------------------------------------------------------------------
>---------------------------------------------------
><!--method #1-->
>
><target name="start.weblogic_600" >
>    <exec dir="${appsrv.home}" executable="start" os="Windows 2000,Windows
>NT">
>            <arg line="startWebLogic.cmd" />
>            <env key="BEA_HOME" value="${bea.home}" />
>    </exec>
>    <exec dir="${appsrv.home}/config/mydomain" executable="/bin/sh"
>os="Linux,Solaris">
>            <arg line="./startWebLogic.sh " />
>    </exec>
></target>
>----------------------------------------------------------------------------
>---------------------------------------------------
><!--method #2-->
>
><target name="start.weblogic_600" >
><exec dir="${appsrv.home}" executable="start" os="Windows 2000,Windows NT">
><arg line="startWebLogic.cmd" />
><env key="BEA_HOME" value="${bea.home}" />
></exec>
><exec executable="${appsrv.home}/config/mydomain/startWebLogicInXTerm.sh"
>os="Linux,Solaris"/>
></target>
>
>------------------------------Contents of
>startWebLogicInXTerm.sh-----------------------------------------------------
>----
>#!/bin/sh
>pushd /usr/local/bea/wlserver6.0/config/mydomain
>xterm -e ".startWebLogic.sh" &
>popd
>
>----------------------------------------------------------------------------
>---------------------------------------------------
>
>Blaine Kendall, QA Developer
>Everypath Canada Corp | www.everypath.com
>
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
PS:   you could write a task which spawned your process through
java.lang.Runtime.exec() in a seperate thread.  So what would happen
is your task would spawn the thread, and return control to ant, thereby
running your process in the background.


-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 




Mime
View raw message