Configuration
systemg uses YAML files to define services and their relationships.Complete example
Configuration sections
version
Required. Specifies the configuration schema version.
project
Optional project metadata used to group services when one supervisor manages
units from more than one project.
id: Stable project identifier. Treat this as durable runtime identity; changing it creates a different project namespace.name: Display name used in status output. You can rename this without changing project identity.
id and name to arbitration.
Configs without project still load. systemg assigns a legacy project identity
from the config directory so existing deployments continue to work after
upgrades, but explicit project.id values are recommended for multi-project
supervisors.
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.
services
Required. Defines the services to manage.
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 any exiton-failure- Restart only on non-zero exit codesnever- Don’t restart
hooks
Run commands when services start or stop.
health_check
Verify services are ready before marking them healthy.
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.| Field | Type | Description |
|---|---|---|
command | string | Command to execute (required) |
depends_on | array | Services that must start first |
env | object | Environment configuration |
restart_policy | string | always, on-failure, or never |
backoff | string | Time between restart attempts |
max_restarts | number | Maximum restart attempts |
hooks | object | Lifecycle event handlers |
health_check | object | Service readiness probe |
cron | string | Cron schedule expression |
deployment | object | Update strategy configuration |
logs | object | Service stdout/stderr capture and rotation settings |
Environment object
Environment sources and inline overrides merged into the service process environment.| Field | Type | Description |
|---|---|---|
vars | object | Key-value environment variables |
file | string | Path to env file |
Hooks object
Lifecycle callbacks you can trigger on service start/stop/restart outcomes.| Field | Type | Description |
|---|---|---|
on_start | object | Commands for start events |
on_stop | object | Commands for stop events |
on_restart | object | Commands for restart events |
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.| Field | Type | Description |
|---|---|---|
command | string | Check command |
url | string | HTTP endpoint (alternative to command) |
interval | string | Time between checks |
timeout | string | Check timeout |
retries | number | Attempts before marking unhealthy |
Deployment object
Controls how restarts are performed and what validation happens before cutover.| Field | Type | Description |
|---|---|---|
strategy | string | rolling or immediate |
pre_start | string | Command to run before starting |
health_check | object | Health check configuration |
grace_period | string | Time before stopping old instance |
blue_green | object | Single-host blue/green rollout settings |
Blue/green deployment object
Single-host zero-downtime options for alternating between two rollout slots (typically ports).| Field | Type | Description |
|---|---|---|
env_var | string | Env var injected with slot value (PORT default) |
slots | array | Exactly two slot values to alternate between |
switch_command | string | Command to switch traffic to candidate slot |
candidate_health_check | object | Optional candidate verification check ({slot} supported in url or command) |
switch_verify | object | Optional post-switch verification check |
state_path | string | Optional persisted active-slot state file path |
version field declares the manifest schema version. systemg accepts the current version as either a string or integer, so version: "1" and version: 1 are equivalent.
When upgrading systemg, the binary reads the declared manifest version first, then migrates supported older manifest schemas into the current runtime configuration before starting services. This compatibility step happens in memory; systemg does not rewrite your YAML file just because it can migrate it.
When downgrading systemg, the older binary can only parse and migrate manifest versions it knows about. If a manifest has been updated to a newer schema, keep a copy of the previous manifest or convert it back to a version supported by the older binary before starting that older release.
::::
