This is a health check that will confirm the PID is running
    and executed by salt.

    If pusutil is available:
        * all architectures are checked

    if psutil is not available:
        * Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
        * AIX/Windows: assume PID is healhty and return True

def is_pid_healthy(pid):
    '''
    This is a health check that will confirm the PID is running
    and executed by salt.

    If pusutil is available:
        * all architectures are checked

    if psutil is not available:
        * Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
        * AIX/Windows: assume PID is healhty and return True
    '''
    if HAS_PSUTIL:
        try:
            proc = psutil.Process(pid)
        except psutil.NoSuchProcess:
            log.warning("PID %s is no longer running.", pid)
            return False
        return any(['salt' in cmd for cmd in proc.cmdline()])

    if salt.utils.platform.is_aix() or salt.utils.platform.is_windows():
        return True

    if not salt.utils.process.os_is_running(pid):
        log.warning("PID %s is no longer running.", pid)
        return False

    cmdline_file = os.path.join('proc', str(pid), 'cmdline')
    try:
        with salt.utils.files.fopen(cmdline_file, 'rb') as fp_:
            return b'salt' in fp_.read()
    except (OSError, IOError) as err:
        log.error("There was a problem reading proc file: %s", err)
        return False