def kill_process(process):
    kill_command = shlex.split('sudo pkill -TERM -s %s' % (process.pid))

    try:
        status = subprocess.call(kill_command)
    except Exception:
        LOG.exception('Unable to pkill process.')

    return status
Kill the provided process by sending it TERM signal using "pkill" shell
dataset/ETHPy150Open StackStorm/st2/st2common/st2common/util/shell.py/kill_process