Scan the path for a binary.

def scan_path(executable="mongod"):
    """Scan the path for a binary.
    """
    for path in os.environ.get("PATH", "").split(":"):
        path = os.path.abspath(path)
        executable_path = os.path.join(path, executable)
        if os.path.exists(executable_path):
            return executable_path