def kill_process(process):
    """
    Kill the provided process by sending it TERM signal using "pkill" shell
    command.

    Note: This function only works on Linux / Unix based systems.

    :param process: Process object as returned by subprocess.Popen.
    :type process: ``object``
    """
    kill_command = shlex.split("sudo pkill -TERM -s %s" % (process.pid))

    try:
        if six.PY3:
            status = subprocess.call(
                kill_command, timeout=100
            )  # pylint: disable=not-callable
        else:
            status = subprocess.call(kill_command)  # pylint: disable=not-callable
    except Exception:
        LOG.exception("Unable to pkill process.")

    return status

    Kill the provided process by sending it TERM signal using "pkill" shell
    command.

    Note: This function only works on Linux / Unix based systems.

    :param process: Process object as returned by subprocess.Popen.
    :type process: ``object``
    
st2common/st2common/util/shell.py