cockpit-plugin-base-react - v1.1.1
    Preparing search index...

    Function useServiceStatus

    • Polls the status of a systemd unit and returns reactive state.

      Parameters

      • unit: string

        The systemd unit name (e.g. "nginx.service").

      • intervalMs: number = DEFAULT_INTERVAL

        How often to re-poll. Defaults to 5000 ms.

      Returns {
          error: string | null;
          loading: boolean;
          refresh: () => Promise<void>;
          status: ServiceStatus;
      }

      { status, loading, error, refresh } — call refresh() to force an immediate re-poll.