Kaushik Lele
Kaushik Lele

Reputation: 6637

How to kill linux process by Ant command using Pid

I know pid of a linux process. I want to kill that process using ANT script.

What ANT target/command should I use ?

In windows I do it this way

What is linux equivalent of this ?

Upvotes: 0

Views: 1230

Answers (1)

Kaushik Lele
Kaushik Lele

Reputation: 6637

Got the answer

<target name="-killProcess">
  <property name="server1.process.pid" value="30916" />
  <echo message="server1.process.pid  ${server1.process.pid}"/>
  <property name="killCommandArg" value=" -9 ${server1.process.pid}" />
  <echo message="killCommandArg ${killCommandArg}"/>
  <exec executable="kill" failonerror="true">
     <arg line="${killCommandArg}" />
  </exec>
</target>

Upvotes: 1

Related Questions