Skip to content

USER GUIDE

CLI: validate / reload / test

Purpose

Validate YAML offline, request a config reload through the API, and dry-run hook scripts — the safe path before touching production networking.

When to use it

  • Before every edit to /etc/netevd/netevd.yaml
  • After adding or renaming hook scripts (validate + restart/reload)
  • When developing a new hook: preview environment variables without firing real events

How to get there

  • Commands: netevd validate, netevd reload, netevd test, netevd version
  • Config path: /etc/netevd/netevd.yaml (override with -c / --config)
  • Global flags on the daemon binary: --dry-run, -v (verbose)

Operate from CLI

  1. Validate the live config (default path):
sudo netevd validate
  1. Validate a staged file before install:
netevd validate -c /tmp/netevd.yaml
  1. Request reload via API (preferred when the daemon supports hot reload):
netevd reload --endpoint http://127.0.0.1:9090
curl -X POST http://127.0.0.1:9090/api/v1/reload -H 'Content-Type: application/json' -d '{}'
  1. When reload is not yet applied server-side, restart the unit (config + hook directory changes):
sudo systemctl restart netevd
journalctl -u netevd -n 30 --no-pager
  1. Dry-run the daemon (no script execution, no routing mutations):
sudo netevd --dry-run -c /etc/netevd/netevd.yaml start -f
  1. Preview hook environment for a script under test:
netevd test /etc/netevd/routable.d/01-notify.sh -i eth0 -t routable --ip 192.168.1.10
  1. Print build/feature matrix:
netevd version --detailed
  1. Empty / fail: Validation errors name the YAML key; reload returns success: false → fall back to systemctl restart netevd; test mode prints env but does not execute — confirm with a real link bounce + journalctl.

  2. Success: ✓ Configuration is valid summary lists backend, interfaces, and policy rules; daemon restarts cleanly; test output shows expected $LINK, $STATE, $ADDRESSES.