【问题标题】:How to kill linux process by Ant command using Pid如何使用 Pid 通过 Ant 命令杀死 linux 进程
【发布时间】:2013-12-02 12:27:14
【问题描述】:

我知道 linux 进程的 pid。 我想使用 ANT 脚本终止该进程。

我应该使用什么 ANT 目标/命令?

在windows中我是这样做的

什么是 linux 等价物?

【问题讨论】:

    标签: linux ant process kill pid


    【解决方案1】:

    找到答案

    <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>
    

    【讨论】:

      猜你喜欢
      • 2015-12-31
      • 1970-01-01
      • 2020-03-02
      • 2014-11-24
      • 2013-10-14
      • 2021-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多