# Service Lifecycle

_Peios / Developing for Peios / Installer and Setup Conversations_

> How registry seeds start installer services and retire first-boot setup.

Installer packages carry registry seeds that define service startup.
A seed is inert until an image or administrator applies it. Installing a
package alone does not select the machine's setup lifecycle.

The `installerd-service` seed starts `installerd` as SYSTEM and restarts it
after failure. A restart restores a listening service, but does not recover
its previous in-memory conversation.

The `oobe-service` seed is intended for the installed system. It starts
`oobed` after the local account service and waits for its readiness signal
before starting the terminal frontend. `oobed` sends readiness after its
socket is bound and its browser setup has been prepared.

The terminal frontend takes `/dev/console` ahead of the normal sign-in
prompt. It also runs as SYSTEM in the supplied seed because the first
administrator has not yet been created. Splitting the frontend from the
engine separates responsibilities; the seed still determines authority.

On successful setup, `oobed` removes its service definition and the terminal
setup definition. On failure, it keeps them so another boot can retry.
Releasing the console lets the normal prompt appear even if setup failed.

## Socket access

The intended installation socket descriptor admits SYSTEM and
Administrators. Setup additionally admits its temporary browser account
when browser setup is offered.

Applying the descriptor is best effort: if `sd` is unavailable or fails,
the daemon warns and retains inherited access. A listening message does
not prove that the intended descriptor was applied. Verify the service's
runtime environment and socket protection before granting access.

## Console output

While a conversation is active, the privileged service suppresses routine
kernel console messages and restores the prior setting afterward.
Emergency kernel messages remain visible. Other services can still write
to the console; <kbd>Ctrl</kbd>+<kbd>L</kbd> asks the terminal frontend to
repaint if those messages disturb the form.

## Terminal geometry

The terminal frontend discovers its size at startup. A render area with
zero width or height draws no content and leaves the conversation intact.
This does not add size reporting to a serial connection: a terminal that
does not report later size changes still needs its size set explicitly.

Use the nonzero dimensions accepted by the frontend's `--size` option when
starting with known geometry. See `install-tui(1)` or `oobe-tui(1)` for the
size-discovery fallback and repaint controls.
