Skip to main content

Command line

lyno [-config PATH] [-validate | -configure] [-headless] [-debug]
FlagDefaultPurpose
-configconfigs/lyno.yamlPath to the main configuration file.
-validateoffValidate the configuration and exit.
-configureoffOpen the configuration editor and exit.
-headlessoffDisable the dashboard and log to stderr.
-debugoffEnable debug logging.

The four modes

# 1. Check the configuration without starting anything.
lyno -config configs/lyno.yaml -validate

# 2. Edit the configuration in a terminal editor.
lyno -config configs/lyno.yaml -configure

# 3. Run with the live dashboard (interactive terminal).
lyno -config configs/lyno.yaml

# 4. Run with plain structured logs (systemd, Docker, CI).
lyno -config configs/lyno.yaml -headless

-validate and -configure both exit without starting the PBX. -configure refuses to run when stdout is not an interactive terminal.

The dashboard is used only when stdout is a terminal, so a run under systemd or in a container logs plainly even without -headless. Pass the flag anyway — it makes the intent explicit and survives being run by hand.

Validating

A successful run prints a summary of what was loaded:

configuration OK
sip: 0.0.0.0:5060 [udp]
codecs: [alaw ulaw]
timezone: Europe/Amsterdam
trunks: 1
overrides: 0 inbound
outbound: 3 global routes (default trunk: "carrier")

A failing run writes error: … to stderr and exits non-zero. Validation is a whole-tree check that collects every problem rather than stopping at the first, so one run usually tells you everything that is wrong:

trunk "carrier": registration.enabled requires auth
tenant acme extension 200 step 1: unknown ring_group "suport"
tenant acme extension 200 step 2: play requires 'file'
media: rtp_port_max must be greater than rtp_port_min

Wire it into CI or a pre-commit hook — the repository's make validate does exactly this.

Running

Configuration is read once, at startup. There is no hot reload and no signal that triggers one: restart the process to apply a change. Startup returns once the listeners are ready.

Under systemd

/etc/systemd/system/lyno.service
[Unit]
Description=Lyno PBX
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStartPre=/usr/local/bin/lyno -config /etc/lyno/configs/lyno.yaml -validate
ExecStart=/usr/local/bin/lyno -config /etc/lyno/configs/lyno.yaml -headless
Restart=on-failure
RestartSec=5s
User=lyno
Group=lyno

# The configuration holds SIP passwords.
UMask=0077
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
NoNewPrivileges=true
ReadOnlyPaths=/etc/lyno

[Install]
WantedBy=multi-user.target

ExecStartPre with -validate turns a bad edit into a failed start with a readable reason, instead of a service that comes up in an unexpected state.

Logging

Without -headless, logs are a tab inside the dashboard. With -headless they go to stderr as structured lines, which is what you want under systemd or Docker.

-debug adds, among other things:

  • the outbound route that matched and the number after digit manipulation;
  • the trunk source addresses discovered from DNS, and every change to them;
  • each dialplan step as it runs, and each step skipped by a time condition;
  • unhandled SIP responses (late or retransmitted provisionals on UDP) that would otherwise be noise at info level.

It is verbose enough that it is a debugging tool rather than a default.

Exit behaviour

  • -validate exits non-zero when the configuration is invalid.
  • The dashboard quits on q or ctrl+c, stopping the PBX.
  • In headless mode, SIGINT and SIGTERM shut down cleanly.