ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McTavish <dmctav...@sandvine.com>
Subject RE: Stopping and starting a service in Win2000 with Ant.
Date Thu, 24 Jul 2003 17:47:20 GMT
you should put single quotes around ${service} if there are multiple words
in the name of the service.

<arg line="net stop '${service}'"/>

d.

-----Original Message-----
From: Antoine Levy-Lambert [mailto:antoine@antbuild.com]
Sent: Thursday, July 24, 2003 7:22 AM
To: Ant Users List; Gian Franco Casula
Subject: Re: Stopping and starting a service in Win2000 with Ant.


you should rather do

----- Original Message -----
From: "Gian Franco Casula" <Gian.Franco.Casula@topficie.nl>
Sent: Thursday, July 24, 2003 12:09 PM


> <property name="service"  value="Netscape Enterprise Server 3.6
(between)"/>
> ...
> <target name="restart" depends="clean"
>  description="Restarts Netscape Enterprise Server" >
>  <exec executable="cmd.exe">
>   <arg line="net stop ${service}"/>
>  </exec>
> </target>
>
should be better
<exec executable="net.exe">
  <arg value="stop"/>
  <arg value="${service}"/>
</exec>
now if ant stalls, it probably means that stdout or stderr do not close
cleanly at the end of the execution of net.exe, or that the command really
hangs.
There are postings on this list about spawning commands.
See in particular this one :
http://marc.theaimsgroup.com/?l=ant-user&m=104322316306620&w=2
Antoine



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

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


Mime
View raw message