Configuration
systemg uses YAML files to define services and their relationships.Complete example
projects: map, keyed by
project id. The example below shows one project’s full set of sections. Project
entries may override env and logs; top-level metrics and status settings
apply across the loaded projects.
Supervisor configuration
Project manifests describe workloads. Supervisor-wide defaults live separately in~/.local/share/systemg/supervisor.xml, or
/var/lib/systemg/supervisor.xml with --sys:
pre_start_secs: default execution budget for deploymentpre_startcommands.startup_stability_ms: survival window for services without a health check.stop_verify_secs: time allowed to confirm that a terminated process is gone.
SYSG_PRE_START_TIMEOUT_SECS remains a higher-precedence compatibility override.
Health-check
attempt_timeout and total_timeout remain in the project
manifest because readiness is workload-specific. IPC polling and live-upgrade
deadlines are protocol invariants and are not operator settings.Registered manifests
When you run a command with-c <file>, the resident supervisor remembers that
manifest’s resolved path for each project it registers. Later commands can omit
-c and target the registered project from any working directory.
sysg restart treats the files at those paths as the source of truth. It reads
and validates every registered manifest before touching a process, then
re-registers added, changed, and removed projects and services. An invalid
manifest returns SG0301 and leaves the
running workloads unchanged.
Configuration sections
version
Required. Specifies the configuration schema version. The current schema is
2. Older version: "1" manifests are no longer accepted. For a legacy
singular-project: manifest, run
sysg migrate, which converts the shape and
emits version: "2". For a loose or existing projects: manifest, update the
version field directly. When upgrading from 0.54.x or older, also follow the
state-layout migration.
projects
The canonical way to declare projects. A map keyed by project id, where each
entry carries that project’s name, services, and optional env / logs
sections. One file can hold as many projects as you like:
project.id. When a name is omitted, the id doubles as the
display name. Every project gets its own state directory — see
State — and you target each one by id with -p/--project
at runtime.
Loose (project-less) services
Top-levelservices: with no project form a loose bundle. They still run,
and their state persists under projects/__loose__/:
Singular project: (deprecated)
The older singular block still parses, so existing single-project manifests keep
working — but it emits a deprecation warning. Prefer projects:.
project: arbitration (which sets both id and name) is also
still accepted. Convert old-shape manifests with
sysg migrate.
See Projects for how one supervisor hosts many
projects at once and how -p/--project targets them at runtime.
env
Optional environment variables shared by all services.
logs
Optional defaults for service stdout/stderr handling.
sink:filecaptures service output to systemg-managed log files.nonediscards service output without creating log-writer threads or files.max_bytes: active log-file size before rotation for thefilesink.max_files: number of rotated files to retain per active log.
sink: none for noisy production services when service output is already collected by another logging pipeline.
status
Optional defaults for status and inspect runtime detail.
snapshot_mode:off,summary, ordetailed.snapshot_interval_secs: seconds between background snapshot refreshes, clamped between 1 and 300.
summary: default. Tracks service state, pid, health, last exit, cron state, and sampled metric summaries while skipping expensive process tree expansion.detailed: includes runtime command details and process/spawn descendants for richerinspectoutput.off: disables background runtime snapshot refresh and uses persisted state plus pid files.
summary globally and use focused inspect --service workflows when deeper investigation is needed.
metrics
Optional tuning for the CPU/memory sampling that powers status and inspect.
retention_minutes: minutes of in-memory samples to keep (default 720).sample_interval_secs: seconds between samples, clamped 1-60 (default 1).max_memory_bytes: memory cap across all sample buffers (default 10 MiB).spillover_path: optional directory for spilling older samples to disk, withspillover_max_bytesandspillover_segment_bytescontrolling disk usage.
services
Defines the services to manage. Each entry under projects: requires its own
services: map. A top-level services: map is optional and defines the loose
bundle.
Service configuration
command
Required. The command to execute.
depends_on
Services that must start before this one.
env
Service-specific environment configuration.
restart_policy
Control how services recover from crashes.
Service logs
Override global logging settings for one service.
always- Restart on non-zero exit codeson-failure- Restart on non-zero exit codesnever- Don’t restart
backoff between attempts and stop
after max_restarts (unlimited when unset).
hooks
Run commands when services start or stop.
cron
Run services on a schedule instead of continuously.
deployment
Control how services update during restarts.
blue_green so traffic can be switched between two slots. A blue-green deployment uses two identical slots, starts the new version in the idle slot, verifies it, and then switches traffic only after the candidate is ready.
Field reference
Service fields
Primary keys available on each service definition.user, group, supplementary_groups, capabilities, limits, and
isolation only take effect in privileged mode - see
Privileged mode for details and examples.
Health checks are configured under deployment.health_check, not as a
top-level service key.
Environment object
Environment sources and inline overrides merged into the service process environment.Hooks object
Lifecycle callbacks you can trigger on service start/stop/restart outcomes.
Each hook has
success and error handlers with:
command- Command to executetimeout- Maximum execution time
Health check object
Probe configuration used to determine readiness/health during deployment workflows.attempt_timeout bounds one probe. total_timeout controls the whole
readiness window, so connection refusals that return immediately do not exhaust
a slow-starting service’s budget. A check fails only after both retries and
total_timeout are exhausted. The failure carries a code by cause:
SG0022 (could not reach),
SG0023 (a probe timed out), or
SG0104 (ran but reported unhealthy).Deployment object
Controls how restarts are performed and what validation happens before cutover.Blue/green deployment object
Single-host zero-downtime options for alternating between two rollout slots (typically ports).
::::info Manifest schema compatibility
The top-level
version field declares the manifest schema version. The current schema is 2, accepted as either a string or integer, so version: "2" and version: 2 are equivalent. version: "1" is no longer accepted.
systemg reads the declared version before the rest of the manifest. Version 1
is rejected rather than silently reinterpreted; version 2 is the only current
runtime schema. systemg never rewrites a manifest as a side effect of starting
services.
When downgrading, the older binary can only parse versions it knows. Keep the
previous manifest or convert it before starting an older release.
Schema validation is separate from manifest shape conversion. To rewrite an
old singular-project: manifest into the canonical
projects: map, run sysg migrate — it prints
the converted YAML to stdout unless --in-place is requested.
::::
