Skip to content

[Bug][Linux]: dashboard updater is killed when stopping its own systemd service #5750

Closed

Description

@robin-liquidium

Client or integration

OpenCodex dashboard

Area

Service lifecycle

Summary

A dashboard update stopped opencodex-proxy.service and killed its own update worker, leaving the proxy offline and the old package installed. The worker uses detached: true, but remains in the service's systemd cgroup. The generated unit's default KillMode=control-group terminates it when the updater stops the service.

Expected: the updater survives proxy shutdown, completes installation, and restarts the service.

Reproduction

  1. Install via npm and run OpenCodex through its generated systemd user service.
  2. Start a dashboard update with restart enabled.
  3. The service stops, the update worker disappears, and update-job.json remains running with a dead PID. The dashboard origin refuses connections.

Version

2.63.0-preview.20260923, updating to 2.64.0. The affected spawn path is also present in the published 2.64.0 package.

Operating system

Ubuntu 24.04.4 LTS, systemd 255.

Provider and model

Not provider-specific.

Cause and tested workaround

src/update/job.ts, spawnGuiUpdateWorker(): the non-Windows branch spawns the worker detached without isolating it from the service cgroup.

Locally wrapping the Linux service-managed worker with systemd-run --user --scope --quiet --collect -- <runtime> <worker args> fixed the failure while retaining KillMode=control-group. We verified the worker moved to its own scope and survived the service stop. Retrying through /api/update/run then installed 2.64.0, restarted the service automatically, and reported succeeded after its health stability check.

Related: #587 covers stale job recovery; #4173 covers broader update orchestration. This report concerns the worker being killed during service shutdown.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bugSomething isn't working
    guiDashboard, tray, settings UI
    on Sep 24, 2026
  2. github-actions commented on Sep 24, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  3. added
    priority: P1High: reproducible failure in a core path (routing, failover, account pool, streaming, usage, auth,
    on Sep 25, 2026
  4. devin-ai-integration commented on Sep 25, 2026

    @devin-ai-integration
    Contributor

    Triage: priority: P1 — Linux dashboard updater is killed by its own systemd service stop, leaving the proxy offline.

    Criteria (P1): High: reproducible failure in a core path (routing, failover, account pool, streaming, usage, auth, install) with no clean workaround; or a small (<300 LOC) bug-fix PR for such a failure.

    Related issues:

    No open pull request addresses this yet.

  5. added a commit that references this issue on Sep 26, 2026
  6. lidge-jun commented on Sep 26, 2026

    @lidge-jun
    Owner

    Fixed on dev by #5908 (merge 45ffcdc): when the proxy runs under systemd (INVOCATION_ID set) and a no-op systemd-run --user --scope probe succeeds, the dashboard update worker is launched through systemd-run --user --scope --quiet --collect, your verified workaround, so it survives the service stop. Every other case keeps the old spawn. Thanks for the precise diagnosis.

  7. added a commit that references this issue on Sep 26, 2026
    b97a392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingguiDashboard, tray, settings UIpriority: P1High: reproducible failure in a core path (routing, failover, account pool, streaming, usage, auth,serviceService lifecycle (WinSW/launchd/scheduler)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions