pkrumins / node-tree-kill

kill trees of processes
MIT License
333 stars 37 forks source link

Running tree kill with superuser via command interface #14

Closed alicecodes closed 8 years ago

alicecodes commented 8 years ago

Hi,

I have a use case where I need to run tree-kill with elevated user privileges to kill a parent and its child processes.

One way to get this use case to work with tree-kill is to call it from the command line like this:

sudo treeKill [pid]

Thanks!

billiegoose commented 8 years ago

Hi Alice, That should be pretty easy. Assuming you have NodeJS installed on your path, this ought to work:

#! /usr/bin/env node
kill = require('tree-kill')
kill(process.argv[2])

I'll consider adding a CLI command to the tree-kill package so it's easier to install

billiegoose commented 8 years ago

I'm done considering, consider it done. Update to v1.1.0 and you'll have a CLI. asciicast