Move updater apply to dedicated systemd runner #6

Open
opened 2025-12-15 00:36:37 +00:00 by 44r0n7 · 0 comments
Owner

Problem

  • Apply runs inside the long-lived API process; restarts/self-kills risk stuck state and no timeout/kill policy.

Proposal

  • Introduce a systemd service (Type=oneshot) like pikit-update-runner that executes apply_version/apply and reports status via state file.
  • API enqueues apply requests and monitors state; runner handles downloads/extract/restart and exits.
  • Add timeout/restart settings and clearer logs.
  • Adjust state/lock handling to be runner-owned; API becomes controller/monitor only.

Acceptance

  • Killing the API mid-apply no longer leaves installs stuck; runner continues/cleans up.
  • Apply has a timeout and writes final state (success/failure).
  • Tests cover enqueue + runner execution and stuck-run recovery.
Problem - Apply runs inside the long-lived API process; restarts/self-kills risk stuck state and no timeout/kill policy. Proposal - Introduce a systemd service (Type=oneshot) like pikit-update-runner that executes apply_version/apply and reports status via state file. - API enqueues apply requests and monitors state; runner handles downloads/extract/restart and exits. - Add timeout/restart settings and clearer logs. - Adjust state/lock handling to be runner-owned; API becomes controller/monitor only. Acceptance - Killing the API mid-apply no longer leaves installs stuck; runner continues/cleans up. - Apply has a timeout and writes final state (success/failure). - Tests cover enqueue + runner execution and stuck-run recovery.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 44r0n7/pi-kit#6