Utility: restart
Utility: restart - restart a service
Status: Built. As-built reference.
Shape: shell built-in (see 0_conventions.md §2).
Part of the shell's service-control trio with
spawn(10_spawn.md) andkill(11_kill.md).restart=killthenspawn.
1. Purpose
restart stops a service and starts it again - the v1 update/recovery mechanism
(live code update is permanently rejected, §2.5/§16). A restarted service may come
back on a different core: identity is stable, location is not (§11, §14.2).
2. Invocation
| Command | Meaning |
|---|---|
restart <name> | Kill <name> then spawn it again (placement re-evaluated). |
restart <name> <core> | Restart and place it on the given core (dev-mode override). |
restart <a>,<b>,... | Restart each (comma list, no spaces, at most 16), each placed per its own contract; a core argument is ignored for a list. |
restart (no name) | Prints usage: restart <name> [core]. |
3. Behaviour & guards
- Placement is re-evaluated from scratch (§9.2): a contract-specified core
re-applies (and may fail with
PlacementInvalidif unavailable); otherwise a fresh round-robin core is chosen. The previous core is not remembered - so a service can transparently move cores across a restart. - The optional
<core>argument is the supervisor'splacement_override(§14.4), exposed for dev-mode use; it is subject to the same strict placement rules. The shell does not check for a dev mode, and a<core>that is not a number is ignored (the restart proceeds unplaced). - The shell's
restartis the SDK'sServiceContext::restart: akill, then a spawn through the supervisor. Akillthat finds nothing to kill is tolerated, so a service that was not running is simply spawned; any other refusal of thekillends the restart as a failure. Results printrestarted: <name>orrestart failed: <name>(anErr). - Same guards as
kill(it is the kill half): requiresSERVICE_CONTROL. There is NO trusted-root refusal, and the shell refuses onlysupervisor,shelland theobservevariants -xhciandehcipass straight through. See11_kill.md§3, corrected 2026-09-26; this said the trusted root was refused and that xhci/ehci were guarded, and neither is true. - Client recovery is the client's job (§14.3): a client of the restarted
service sees
EndpointDead/CapRevokedon its next call and must reacquire by name through the kernel name directory (AcquireSendCap) - theregistryservice was retired in naming Phase 4. The kernel does not rebind for it.
4. Capabilities
SERVICE_CONTROL(WRITE) for the kill half andSPAWN(WRITE) for the spawn half - both held by the shell.- Console output for the result / error line.
5. Non-goals
- No live/in-place update. Restart-with-new-binary is the only update path
(§2.5).
restartdoes not patch a running service.
6. Conformance
Conforms: own restart help / restart version (with a real example, per 0_conventions.md); listed by the shell's
top-level help under Services as restart <name>[,name,...] [core]. See
0_conventions.md §3.