You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by coonay <co...@yahoo.com> on 2009/05/08 11:41:58 UTC

hang up even inputstring=""

the ant will be hang up even the inputstring=""  and timeouted


<target  name="cmd" >    
      <echo message="PSEXEC is running..."/>
	  <!--
	  <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
	  -->
	  <exec executable="cmd" dir="." inputstring="" timeout="10000">
	    <arg value="/c"/>
        <arg value="radia.bat"/>
        <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD} ${CMD}
${ARG}"/>	
        <env key="RHOST" value="${RHOST}"/>			
    </exec>	  
	    
  </target> 

-----
http://coonay2010expo.blogspot.com/ http:coonay 
-- 
View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443019.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: hang up even inputstring=""

Posted by coonay <co...@yahoo.com>.
radia.bat:

@echo off

set EXE=psexec \\%RHOST% -u %USER% -p %PASSWORD% %CMD% %ARG%
set EXE=psexec \\%RHOST% -s %CMD% %ARG%
echo EXE=%EXE%
echo @echo off >tmp.bat
echo %EXE%>>tmp.bat

start /WAIT tmp.bat >radia.log 2>&1




David Weintraub wrote:
> 
> The only solution is not to call an <exec> that waits for input when
> that input won't be happening. Otherwise, the <exec> task won't time
> out.
> 
> I guess the question is what are you trying to do with the <exec>
> task, and is there another way around this without necessarily waiting
> for input. What does the "radia.bat" program do? Why do you specify a
> blank input string? If there is no need for an input string, why not
> simply leave out that attribute to the <exec> task?
> 
> On Mon, May 11, 2009 at 2:54 AM, coonay <co...@yahoo.com> wrote:
>>
>> do you know there is a fix to thist problem?
>> or do u honw if there is a workaround existed?
>> Any help is highly apprecitated.
>>
>> David Weintraub wrote:
>>>
>>> I see this is on a Windows system. Windows doesn't do process forking.
>>> It throws off a thread using the CreateProcess call. It's very similar
>>> to forking, but not quite. If the created thread is waiting for input,
>>> and the CreateProcess call was told to wait for input, everything
>>> freezes, and the timeout value for the <exec> task simply never gets a
>>> chance to timeout.
>>>
>>> I know I've had similar problems with Perl scripts running under Ant
>>> on Windows systems. What works for Unix/Linux simply doesn't work the
>>> same way on Windows.
>>>
>>>
>>> On Fri, May 8, 2009 at 5:41 AM, coonay <co...@yahoo.com> wrote:
>>>>
>>>> the ant will be hang up even the inputstring=""  and timeouted
>>>>
>>>>
>>>> <target  name="cmd" >
>>>>      <echo message="PSEXEC is running..."/>
>>>>          <!--
>>>>          <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
>>>>          -->
>>>>          <exec executable="cmd" dir="." inputstring="" timeout="10000">
>>>>            <arg value="/c"/>
>>>>        <arg value="radia.bat"/>
>>>>        <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD}
>>>> ${CMD}
>>>> ${ARG}"/>
>>>>        <env key="RHOST" value="${RHOST}"/>
>>>>    </exec>
>>>>
>>>>  </target>
>>>>
>>>> -----
>>>> http://coonay2010expo.blogspot.com/ http:coonay
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443019.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
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> David Weintraub
>>> qazwart@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>>
>>
>>
>> -----
>> http://coonay2010expo.blogspot.com/ http:coonay
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23478006.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
>>
>>
> 
> 
> 
> -- 
> David Weintraub
> qazwart@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


-----
http://coonay2010expo.blogspot.com/ http:coonay 
-- 
View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23518098.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: hang up even inputstring=""

Posted by coonay <co...@yahoo.com>.
http://ant.apache.org/faq.html#input-makes-exec-hang
http://ant.apache.org/faq.html#input-makes-exec-hang ,that's why i make
input="",
but i found it makes no difference without input property

David Weintraub wrote:
> 
> The only solution is not to call an <exec> that waits for input when
> that input won't be happening. Otherwise, the <exec> task won't time
> out.
> 
> I guess the question is what are you trying to do with the <exec>
> task, and is there another way around this without necessarily waiting
> for input. What does the "radia.bat" program do? Why do you specify a
> blank input string? If there is no need for an input string, why not
> simply leave out that attribute to the <exec> task?
> 
> On Mon, May 11, 2009 at 2:54 AM, coonay <co...@yahoo.com> wrote:
>>
>> do you know there is a fix to thist problem?
>> or do u honw if there is a workaround existed?
>> Any help is highly apprecitated.
>>
>> David Weintraub wrote:
>>>
>>> I see this is on a Windows system. Windows doesn't do process forking.
>>> It throws off a thread using the CreateProcess call. It's very similar
>>> to forking, but not quite. If the created thread is waiting for input,
>>> and the CreateProcess call was told to wait for input, everything
>>> freezes, and the timeout value for the <exec> task simply never gets a
>>> chance to timeout.
>>>
>>> I know I've had similar problems with Perl scripts running under Ant
>>> on Windows systems. What works for Unix/Linux simply doesn't work the
>>> same way on Windows.
>>>
>>>
>>> On Fri, May 8, 2009 at 5:41 AM, coonay <co...@yahoo.com> wrote:
>>>>
>>>> the ant will be hang up even the inputstring=""  and timeouted
>>>>
>>>>
>>>> <target  name="cmd" >
>>>>      <echo message="PSEXEC is running..."/>
>>>>          <!--
>>>>          <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
>>>>          -->
>>>>          <exec executable="cmd" dir="." inputstring="" timeout="10000">
>>>>            <arg value="/c"/>
>>>>        <arg value="radia.bat"/>
>>>>        <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD}
>>>> ${CMD}
>>>> ${ARG}"/>
>>>>        <env key="RHOST" value="${RHOST}"/>
>>>>    </exec>
>>>>
>>>>  </target>
>>>>
>>>> -----
>>>> http://coonay2010expo.blogspot.com/ http:coonay
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443019.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
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> David Weintraub
>>> qazwart@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>>
>>
>>
>> -----
>> http://coonay2010expo.blogspot.com/ http:coonay
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23478006.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
>>
>>
> 
> 
> 
> -- 
> David Weintraub
> qazwart@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 
http://ant.apache.org/faq.html#input-makes-exec-hang
http://ant.apache.org/faq.html#input-makes-exec-hang 

-----
http://coonay2010expo.blogspot.com/ http:coonay 
-- 
View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23518172.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: hang up even inputstring=""

Posted by Eric Fetzer <el...@yahoo.com>.
It looks like you're using a batch file to call psexec and run the process on another machine.  That's pretty much the same thing as running psexec from exec to run the process on the other machine.  If you want your file output redirect to work:

1.  Create a bat file that runs the program you want to run on the other machine and redirects the output.  For example:
2.  In Ant, copy the batch file to the machine where you're going to run it
3.  In Ant, use the exec task to use psexec calling the batch file you just copied over to the other machine
4.  In Ant, delete the batch file you copied to the other machine




________________________________
From: David Weintraub <qa...@gmail.com>
To: Ant Users List <us...@ant.apache.org>
Sent: Monday, May 11, 2009 9:14:48 AM
Subject: Re: <exec> hang up even inputstring=""

The only solution is not to call an <exec> that waits for input when
that input won't be happening. Otherwise, the <exec> task won't time
out.

I guess the question is what are you trying to do with the <exec>
task, and is there another way around this without necessarily waiting
for input. What does the "radia.bat" program do? Why do you specify a
blank input string? If there is no need for an input string, why not
simply leave out that attribute to the <exec> task?

On Mon, May 11, 2009 at 2:54 AM, coonay <co...@yahoo.com> wrote:
>
> do you know there is a fix to thist problem?
> or do u honw if there is a workaround existed?
> Any help is highly apprecitated.
>
> David Weintraub wrote:
>>
>> I see this is on a Windows system. Windows doesn't do process forking.
>> It throws off a thread using the CreateProcess call. It's very similar
>> to forking, but not quite. If the created thread is waiting for input,
>> and the CreateProcess call was told to wait for input, everything
>> freezes, and the timeout value for the <exec> task simply never gets a
>> chance to timeout.
>>
>> I know I've had similar problems with Perl scripts running under Ant
>> on Windows systems. What works for Unix/Linux simply doesn't work the
>> same way on Windows.
>>
>>
>> On Fri, May 8, 2009 at 5:41 AM, coonay <co...@yahoo.com> wrote:
>>>
>>> the ant will be hang up even the inputstring=""  and timeouted
>>>
>>>
>>> <target  name="cmd" >
>>>      <echo message="PSEXEC is running..."/>
>>>          <!--
>>>          <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
>>>          -->
>>>          <exec executable="cmd" dir="." inputstring="" timeout="10000">
>>>            <arg value="/c"/>
>>>        <arg value="radia.bat"/>
>>>        <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD} ${CMD}
>>> ${ARG}"/>
>>>        <env key="RHOST" value="${RHOST}"/>
>>>    </exec>
>>>
>>>  </target>
>>>
>>> -----
>>> http://coonay2010expo.blogspot.com/ http:coonay
>>> --
>>> View this message in context:
>>> http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443019.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
>>>
>>>
>>
>>
>>
>> --
>> David Weintraub
>> qazwart@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>
>
> -----
> http://coonay2010expo.blogspot.com/ http:coonay
> --
> View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23478006.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
>
>



-- 
David Weintraub
qazwart@gmail.com

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


      

Re: hang up even inputstring=""

Posted by David Weintraub <qa...@gmail.com>.
The only solution is not to call an <exec> that waits for input when
that input won't be happening. Otherwise, the <exec> task won't time
out.

I guess the question is what are you trying to do with the <exec>
task, and is there another way around this without necessarily waiting
for input. What does the "radia.bat" program do? Why do you specify a
blank input string? If there is no need for an input string, why not
simply leave out that attribute to the <exec> task?

On Mon, May 11, 2009 at 2:54 AM, coonay <co...@yahoo.com> wrote:
>
> do you know there is a fix to thist problem?
> or do u honw if there is a workaround existed?
> Any help is highly apprecitated.
>
> David Weintraub wrote:
>>
>> I see this is on a Windows system. Windows doesn't do process forking.
>> It throws off a thread using the CreateProcess call. It's very similar
>> to forking, but not quite. If the created thread is waiting for input,
>> and the CreateProcess call was told to wait for input, everything
>> freezes, and the timeout value for the <exec> task simply never gets a
>> chance to timeout.
>>
>> I know I've had similar problems with Perl scripts running under Ant
>> on Windows systems. What works for Unix/Linux simply doesn't work the
>> same way on Windows.
>>
>>
>> On Fri, May 8, 2009 at 5:41 AM, coonay <co...@yahoo.com> wrote:
>>>
>>> the ant will be hang up even the inputstring=""  and timeouted
>>>
>>>
>>> <target  name="cmd" >
>>>      <echo message="PSEXEC is running..."/>
>>>          <!--
>>>          <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
>>>          -->
>>>          <exec executable="cmd" dir="." inputstring="" timeout="10000">
>>>            <arg value="/c"/>
>>>        <arg value="radia.bat"/>
>>>        <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD} ${CMD}
>>> ${ARG}"/>
>>>        <env key="RHOST" value="${RHOST}"/>
>>>    </exec>
>>>
>>>  </target>
>>>
>>> -----
>>> http://coonay2010expo.blogspot.com/ http:coonay
>>> --
>>> View this message in context:
>>> http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443019.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
>>>
>>>
>>
>>
>>
>> --
>> David Weintraub
>> qazwart@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>
>
> -----
> http://coonay2010expo.blogspot.com/ http:coonay
> --
> View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23478006.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
>
>



-- 
David Weintraub
qazwart@gmail.com

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


Re: hang up even inputstring=""

Posted by coonay <co...@yahoo.com>.
do you know there is a fix to thist problem?
or do u honw if there is a workaround existed?
Any help is highly apprecitated.

David Weintraub wrote:
> 
> I see this is on a Windows system. Windows doesn't do process forking.
> It throws off a thread using the CreateProcess call. It's very similar
> to forking, but not quite. If the created thread is waiting for input,
> and the CreateProcess call was told to wait for input, everything
> freezes, and the timeout value for the <exec> task simply never gets a
> chance to timeout.
> 
> I know I've had similar problems with Perl scripts running under Ant
> on Windows systems. What works for Unix/Linux simply doesn't work the
> same way on Windows.
> 
> 
> On Fri, May 8, 2009 at 5:41 AM, coonay <co...@yahoo.com> wrote:
>>
>> the ant will be hang up even the inputstring=""  and timeouted
>>
>>
>> <target  name="cmd" >
>>      <echo message="PSEXEC is running..."/>
>>          <!--
>>          <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
>>          -->
>>          <exec executable="cmd" dir="." inputstring="" timeout="10000">
>>            <arg value="/c"/>
>>        <arg value="radia.bat"/>
>>        <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD} ${CMD}
>> ${ARG}"/>
>>        <env key="RHOST" value="${RHOST}"/>
>>    </exec>
>>
>>  </target>
>>
>> -----
>> http://coonay2010expo.blogspot.com/ http:coonay
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443019.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
>>
>>
> 
> 
> 
> -- 
> David Weintraub
> qazwart@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


-----
http://coonay2010expo.blogspot.com/ http:coonay 
-- 
View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23478006.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: hang up even inputstring=""

Posted by David Weintraub <qa...@gmail.com>.
I see this is on a Windows system. Windows doesn't do process forking.
It throws off a thread using the CreateProcess call. It's very similar
to forking, but not quite. If the created thread is waiting for input,
and the CreateProcess call was told to wait for input, everything
freezes, and the timeout value for the <exec> task simply never gets a
chance to timeout.

I know I've had similar problems with Perl scripts running under Ant
on Windows systems. What works for Unix/Linux simply doesn't work the
same way on Windows.


On Fri, May 8, 2009 at 5:41 AM, coonay <co...@yahoo.com> wrote:
>
> the ant will be hang up even the inputstring=""  and timeouted
>
>
> <target  name="cmd" >
>      <echo message="PSEXEC is running..."/>
>          <!--
>          <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
>          -->
>          <exec executable="cmd" dir="." inputstring="" timeout="10000">
>            <arg value="/c"/>
>        <arg value="radia.bat"/>
>        <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD} ${CMD}
> ${ARG}"/>
>        <env key="RHOST" value="${RHOST}"/>
>    </exec>
>
>  </target>
>
> -----
> http://coonay2010expo.blogspot.com/ http:coonay
> --
> View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443019.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
>
>



-- 
David Weintraub
qazwart@gmail.com

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


Re: hang up even inputstring=""

Posted by coonay <co...@yahoo.com>.
D:\workspace\ClientAutomation>java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

D:\workspace\ClientAutomation>ant -version
Apache Ant version 1.7.1 compiled on June 27 2008

coonay wrote:
> 
> the ant will be hang up even the inputstring=""  and timeouted
> 
> 
> <target  name="cmd" >    
>       <echo message="PSEXEC is running..."/>
> 	  <!--
> 	  <exec executable="cmd" dir="." os="Windows_NT" inputstring="">
> 	  -->
> 	  <exec executable="cmd" dir="." inputstring="" timeout="10000">
> 	    <arg value="/c"/>
>         <arg value="radia.bat"/>
>         <arg line="\\${RHOST}  -realtime -u ${USER} -p ${PASSWORD} ${CMD}
> ${ARG}"/>	
>         <env key="RHOST" value="${RHOST}"/>			
>     </exec>	  
> 	    
>   </target> 
> 


-----
http://coonay2010expo.blogspot.com/ http:coonay 
-- 
View this message in context: http://www.nabble.com/%3Cexec%3E-hang-up-even-inputstring%3D%22%22-tp23443019p23443128.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