Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D58779B22 for ; Wed, 8 Feb 2012 16:18:20 +0000 (UTC) Received: (qmail 85953 invoked by uid 500); 8 Feb 2012 16:18:20 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 85894 invoked by uid 500); 8 Feb 2012 16:18:19 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 85886 invoked by uid 99); 8 Feb 2012 16:18:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2012 16:18:19 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.139.212.163] (HELO nm4.bullet.mail.bf1.yahoo.com) (98.139.212.163) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Feb 2012 16:18:10 +0000 Received: from [98.139.212.145] by nm4.bullet.mail.bf1.yahoo.com with NNFMP; 08 Feb 2012 16:17:50 -0000 Received: from [98.139.212.237] by tm2.bullet.mail.bf1.yahoo.com with NNFMP; 08 Feb 2012 16:17:50 -0000 Received: from [127.0.0.1] by omp1046.mail.bf1.yahoo.com with NNFMP; 08 Feb 2012 16:17:50 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 30156.39565.bm@omp1046.mail.bf1.yahoo.com Received: (qmail 6718 invoked by uid 60001); 8 Feb 2012 16:17:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1328717869; bh=3bH7xlwTH8XL93esrqUTJ0I1FXOTyd53C60HiZrkYd8=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=tD7GC2A5psJdikRVuR6+/3NdyJ/zO/r7EMn9hHQKduTpk5XtO5O1feJWhLViGiBsGpl2o8Sm7/u9Y7sg4NwsvYdGzpgcNnH/GE5DF6kV2EQ8/8MbJagBjQzRMxKXXcnYkXJEKmqT/tpU+sCcplYXGr+frQb1mmms9MsXGn5hDVI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=3EF2Ej4XX9bYt60m6GK2s+8xEjTPYuSQvAkw8dlYYXPsaD39aEQ6lIlCyCoov1sSWPCAOv574ZP3dC1ywQNKb0h5RWWHo7+Y25pGnyZHGMLQhzxU3MqOw1q5zDg6Ga13Cj3/cSzfOfpkEFdXWowKLQcZlgkCglfWcyGjSeCgSl8=; X-YMail-OSG: NovNAnoVM1nwDRUZJEs8tO.rdGepeu_HIZztqGDKxgX2Ywn DcnfoyzbLO_XQ5sY1eUzPMpum1B1fK4rf.wn94D3jjbo8WMGvAzP2yknkOLB yxv3L4NpMH4kaq9qX5JAuKscVYONrwdMhSNa9.gZEL2.37OdJjqbnFOGoSsf surfh.C_eXQNGTcbaBdPclzOBhCoTa.cqk9BUuRQ9GELMRw5RWR_nD_HLaKs Fju2tPkDMeWSi3twqtwAv7ZPfPq5IbPTvLp.rn33Ix5tYc3WTwc_4VonK7pX KCFxLKfXustVa6wHlhd6vfqbr3xWL48N8MVj.TFM0g_DMdgrBt8QZUrs__rD 3SGNm0aYjMIxMb944u5HRM5SiDgcooj3C6iyG7Zq5ed7QOFV4p27cmc_fXGi jtKUl6Zy3TGqHvZ_8ATkjpV3GC7nkNSSWMIgPQRlWzwlcNRkKaqLtdyhlWZn TqCkJ2a8FpZ5bBmQJ1hL9FkNvXSfUD0fnj181ZbCEyWxyNylL Received: from [64.184.229.51] by web161206.mail.bf1.yahoo.com via HTTP; Wed, 08 Feb 2012 08:17:49 PST X-Mailer: YahooMailWebService/0.8.116.338427 References: <1328674236.91530.YahooMailNeo@web161204.mail.bf1.yahoo.com> Message-ID: <1328717869.6152.YahooMailNeo@web161206.mail.bf1.yahoo.com> Date: Wed, 8 Feb 2012 08:17:49 -0800 (PST) From: Vimil Saju Reply-To: Vimil Saju Subject: Re: Regarding exec task To: Ant Users List In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1938299484-993205723-1328717869=:6152" --1938299484-993205723-1328717869=:6152 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable This sounds good, but won't it kill processes that wasn't started by my scr= ipt too?=0A=0A=0A________________________________=0A From: Adam Bruss =0ATo: Ant Users List ; Vimil Saju =0ASent: Wednesday, February 8, 2012 6:34 AM=0ASubject: R= E: Regarding exec task=0A =0ASet failonerror=3Dfalse on the parent tasks. G= et the return code. If return code not 0 then call a common target which ex= ecutes your own personal "kill-zombie-processes" task and then fails the bu= ild using . "kill-zombie-processes" kills all possible still running = child processes. You need to know what the process names are. It's differen= t than what you asked for but it works for me.=0A=0AMy kill target:=0A=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A=A0=A0=A0 =A0=A0=A0 =0A= =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =0A=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0= =A0 =0A=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =0A=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 = =0A=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =0A=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =0A=A0=A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= February 07, 2012 10:11 PM=0ATo: Ant Users List=0ASubject: Regarding exec t= ask=0A=0AHi,=0A=0AI noticed that on windows, if I use the exec task to run = a batch script which in turn starts other processes then if kill ant then t= he sub-processes created by the batch script still continues to run. I did = some research on google and found that the default java implementation of P= rocess.destroy does not kill the child processes created by a process on wi= ndows. I also found that there are some third party libraries like jvnet th= at provide the capability of killing all processes created by a process on = windows. So I thought of somehow extending the 'Execute' class of ant to us= e the functionality of this 3rd party library, but I find that its difficul= t if not impossible to extend this class. I can't find a way to provide my = implementation of Process class that does something different when its dest= roy method is called. Other core tasks such as java task directly create an= instance of the 'Execute' class which makes it difficult to globally chang= e how a=0Aprocess is destroyed within ant. If anyone can provide some sugge= stions on how this can be accomplished I will be very grateful.=0A=0A=A0Cur= rently the build scripts of my project uses the exec task to run a bunch of= batch scripts in parallel which in turn execute sql scripts by starting of= f another process. I have written the ant script such that if any sql scrip= ts fail then the ant build fails.When the build fails I notice that all the= batch scripts have terminated as expected but the processes spawned by the= se batch scripts still continue to run.=0A=0AAny help is greatly appreciate= d.=0A=0AThanks=0AVimil=0A=0A-----------------------------------------------= ----------------------=0ATo unsubscribe, e-mail: user-unsubscribe@ant.apach= e.org=0AFor additional commands, e-mail: user-help@ant.apache.org --1938299484-993205723-1328717869=:6152--