Skip to main content

Hot Reload

Runix can reload its configuration file without restarting the daemon or interrupting healthy processes.

Usage​

# Reload config via CLI
runix config reload

# Or send SIGHUP to the daemon (if supported)

How It Works​

Config Diffing​

The internal/config/hotreload.go module computes the diff between old and new configs:

func DiffConfigs(old, new *types.RunixConfig) *ConfigDiff

What the diff detects​

ChangeAction
New process addedStart the new process
Process removedStop and remove the process
Process config changedReload (graceful restart) the process
Process unchangedNo action — process continues running
Defaults changedApplied to processes on next restart
Cron jobs changedUpdate scheduler
New cron jobRegister with scheduler
Removed cron jobUnregister from scheduler

Diff Output​

[Runix] Configuration changes:
+ process "worker" added
- process "legacy-api" removed
~ process "api" env.PORT changed: "8080" → "9090"
~ defaults.max_restarts changed: 5 → 10

Safety Guarantees​

  • Validation first — The new config is validated before any changes are applied
  • No disruption — Unchanged processes continue running without interruption
  • Rollback on failure — If applying changes fails, the daemon keeps the old config

Config Reload Without Daemon​

If the daemon is not running, runix config reload still reads and validates the config:

runix config reload
# [Runix] Config reloaded (daemon not running, changes apply on next start)

What's Next​