1

In windows we can use

<target name="stopnode" description="Stops all instances of node">
    <exec executable="taskkill">
        <arg value="/IM"/>
        <arg value="node.exe"/>
    </exec>
</target>

in Mac when I use kill -9 process_id

or killall node

based on the SO post Stop node.js program from command line.

It says process not found when I am trying to use the following code to kill the node server

<exec osfamily="unix" executable="killall" failonerror="false" resultproperty="prp.result.kill">
    <arg line="node"/>
</exec>
Community
  • 1
  • 1
Nav
  • 10,304
  • 20
  • 56
  • 83
  • This question appears to be off-topic because it is not about programming. Perhaps [Super User](http://superuser.com/) or [Server Fault](http://serverfault.com/) would be a better place to ask. – jww Jun 13 '14 at 08:04
  • Yeah it might I however have seen similar questions on stackoverflow so thought of posting here. Anyways I will post there too ..Thanks – Nav Jun 13 '14 at 08:17
  • No big deal @Nav. I thought it was a good question, so I up'd it anyway. You genuinely might have better luck on the other sites. It never hurts to ask. – jww Jun 13 '14 at 08:19

1 Answers1

0

I am now using pkill command for this

pkill node

Nav
  • 10,304
  • 20
  • 56
  • 83