def METHOD_NAME(client1, process_name, count, timeout=180, interval=5):
    end_time = datetime.now() + timedelta(seconds=timeout)
    log.info("Wait for the process to start or stop")
    while end_time > datetime.now():
        out, rc = client1.exec_command(
            sudo=True,
            cmd=f"ceph orch ps | grep {process_name} | wc -l ",
            check_ec=False,
        )
        out2, rc = client1.exec_command(
            sudo=True, cmd=f"ceph orch ps | grep {process_name} ", check_ec=False
        )
        print(out2)
        output = out.rstrip()
        log.info(f"Current mds count = {output}")
        log.info(f"Expected mds count = {count}")
        if output == count:
            return 0
        sleep(interval)
    raise CommandFailed