Kevin

Ops Service Control - Probe, Refuse, Restart

How an operator restarts a machine service from Marco, and why a refusal carries its own remedy.

Ops Service Control - Probe, Refuse, Restart (v2026-08-22T175604Z-b502e8bc6d) 2026-08-22 | How an operator restarts a machine service from Marco, and why a refusal carries its own remedy. 1 - SERVICE CONTROL - Operator restarts a service Operator POST /api/ops/services/{service_id}/restart ops_service_router.restart_service service_control.restart 409 if refusal service_control.restart _run systemctl restart _run docker restart service request restart command 2 - PROBE - Check service controllability service_control.inventory load_specs probe_controllability _systemd_can_control _docker_can_control _windows_can_control _windows_process_can_control load config 3 - CONFIG - Load service specifications ops-services.yaml services defaults load_specs yaml.safe_load ServiceSpec creation config file 1. Operator sends restart request 2. Router checks controllability 3. Service is probed for control 4. Restart command is issued 5. Response is sent back ops-services.yaml snippet version: 1 defaults: actions: [restart] stop_timeout_s: 30 services: - id: ci-runner-windows title: CI runner (Windows + Linux jobs) kind: windows_service name: GiteaActionsRunner actions: [restart] HTTP Response on Refusal HTTP/1.1 409 Conflict Content-Type: application/json { "error": "this account may query 'GiteaActionsRunner' but not start/stop it. Grant start/stop once, from an elevated p… } The service control system probes each service for controllability before offering restart options to the operator. If a service is not controllable, it provides a specific remedy in the response. Legend actor = initiates work · process = code path · store = state on disk · bus = durable queue · dashed = separate process cyan = request flow · pink = state read/write · dashed green = pull / return path · red = refusal As of 2026-08-22 22:15 UTC, from commit d94c202

Provenance

This drawing is generated, not drawn. It is rebuilt from the source files below, so when they change the picture changes — a diagram here cannot quietly describe a system that no longer works this way.

Owner
Kevin
Slug
ops-service-control
Rendered
2026-08-22T175604Z
From commit
b502e8bc6d
Updated
22 Aug 2026, 22:15 UTC
Sources at
d94c202
Watches
4 paths
  • daemon/src/service_control.py
  • daemon/src/ops_service_router.py
  • daemon/config/ops-services.yaml
  • daemon/src/systemd_sweep.py