You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by viet nguyen <vi...@gmail.com> on 2009/05/05 17:19:23 UTC

How to kill child process with control-c

I have an exec task (spawn=false) that calls jmeter.sh/jmeter.bat which in
turn launches a java process.  Control-C only kills ant but does nothing to
jmeter java process.  I can confirm that jmeter app doesn't have any special
shutdown hooks as I can kill the process with control-c when
jmeter.sh/jmeter.bat is executed directly at the command line.
My ant version=1.7.1
-- 
View this message in context: http://www.nabble.com/How-to-kill-child-process-with-control-c-tp23389659p23389659.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


RE: How to kill child process with control-c

Posted by viet nguyen <vi...@gmail.com>.
Thanks for the quick replies.
As a workaround I can probably duplicate what jmeter.sh does in Ant, ie
specifying all the GC flags, heap sizes, etc and launch java directly.  




mgainty wrote:
> 
> 
> your term utility does not have cascade capability
> and calling ant exec task creates another process
> 
> use java instead with 
> spawn="false"
> 
> fork="false"
> 
> 
> http://ant.apache.org/manual/CoreTasks/java.html
> 
> HTH
> Martin 
> ______________________________________________ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note
> de déni et de confidentialité
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the
> contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement et
> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
> les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
>> Date: Tue, 5 May 2009 08:19:23 -0700
>> From: viet.atx@gmail.com
>> To: user@ant.apache.org
>> Subject: How to kill child process with control-c
>> 
>> 
>> I have an exec task (spawn=false) that calls jmeter.sh/jmeter.bat which
>> in
>> turn launches a java process.  Control-C only kills ant but does nothing
>> to
>> jmeter java process.  I can confirm that jmeter app doesn't have any
>> special
>> shutdown hooks as I can kill the process with control-c when
>> jmeter.sh/jmeter.bat is executed directly at the command line.
>> My ant version=1.7.1
>> -- 
>> View this message in context:
>> http://www.nabble.com/How-to-kill-child-process-with-control-c-tp23389659p23389659.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
> 
> _________________________________________________________________
> Hotmail® has a new way to see what's up with your friends.
> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
> 

-- 
View this message in context: http://www.nabble.com/How-to-kill-child-process-with-control-c-tp23389659p23390448.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


RE: How to kill child process with control-c

Posted by Martin Gainty <mg...@hotmail.com>.
your term utility does not have cascade capability
and calling ant exec task creates another process

use java instead with 
spawn="false"

fork="false"


http://ant.apache.org/manual/CoreTasks/java.html

HTH
Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Tue, 5 May 2009 08:19:23 -0700
> From: viet.atx@gmail.com
> To: user@ant.apache.org
> Subject: How to kill child process with control-c
> 
> 
> I have an exec task (spawn=false) that calls jmeter.sh/jmeter.bat which in
> turn launches a java process.  Control-C only kills ant but does nothing to
> jmeter java process.  I can confirm that jmeter app doesn't have any special
> shutdown hooks as I can kill the process with control-c when
> jmeter.sh/jmeter.bat is executed directly at the command line.
> My ant version=1.7.1
> -- 
> View this message in context: http://www.nabble.com/How-to-kill-child-process-with-control-c-tp23389659p23389659.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009

Re: How to kill child process with control-c

Posted by Francis Galiegue <fg...@one2team.com>.
Le mardi 05 mai 2009, viet nguyen a écrit :
> 
> I have an exec task (spawn=false) that calls jmeter.sh/jmeter.bat which in
> turn launches a java process.  Control-C only kills ant but does nothing to
> jmeter java process.  I can confirm that jmeter app doesn't have any special
> shutdown hooks as I can kill the process with control-c when
> jmeter.sh/jmeter.bat is executed directly at the command line.
> My ant version=1.7.1

I have exactly the same problem with <junit fork="true">... So, this is not 
limited to <exec>.

I haven't had the opportunity to reproduce the problem yet, but my guess is 
that the stdin, stdout and stderr of the fork()ed process(es) are not set to 
the current terminal. Hence, the INTR signal doesn't propagate to ant's 
children.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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