Configuration Defaults
When a process configuration doesn't specify a value, Runix applies defaults. These come from two sources:
- Built-in defaults — hardcoded in
internal/config/defaults.go - Config-level defaults — specified in the
defaults:section ofrunix.yaml
Precedence
Process-level config > Config-level defaults > Built-in defaults
Process-level fields always override config-level defaults, which always override built-in defaults.
Built-in Defaults
| Field | Default Value |
|---|---|
restart_policy | on-failure |
max_restarts | 5 |
backoff_base | 1s |
backoff_max | 60s |
stop_timeout | 5s |
stop_signal | SIGTERM |
namespace | default |
instances | 1 |
priority | 0 |
health_check.interval | 10s |
health_check.timeout | 5s |
health_check.retries | 3 |
health_check.grace_period | 0s |
watch.debounce | 100ms |
logging.max_size | 10485760 (10MB) |
logging.max_files | 5 |
logging.max_age | 168h (7 days) |
Config-Level Defaults
Override built-in defaults for all processes in a config file:
defaults:
restart_policy: always
max_restarts: 20
backoff_base: 2s
backoff_max: 120s
stop_timeout: 10s
stop_signal: SIGTERM
processes:
api:
entrypoint: ./cmd/api
# Inherits restart_policy: always, max_restarts: 20, etc.
worker:
entrypoint: worker.py
max_restarts: 3
# Overrides max_restarts to 3, inherits everything else
Environment Profiles
Profiles let you override defaults for different environments:
defaults:
restart_policy: on-failure
max_restarts: 5
profiles:
production:
defaults:
restart_policy: always
max_restarts: 50
backoff_max: 300s
staging:
defaults:
restart_policy: on-failure
max_restarts: 10
development:
defaults:
restart_policy: never
max_restarts: 0
Select a profile with the --profile flag:
runix start --profile production
What's Next
- Configuration Reference — Full YAML schema
- Extends — Config file inheritance