Skip to content

Environment variables ​

cairn reads very few environment variables. This page lists them all. Variables for your app are set in cairn.toml instead, with [env] and env_file (see cairn.toml).

Variables you might set ​

VariableEffect
CAIRN_PROGRESS=plainPrint progress as plain lines instead of redrawing them. Any other value does nothing.
NO_COLORWhen set to anything, never use colour.
CLICOLOR_FORCEWhen set to anything, use colour even into a pipe.
CLICOLOR=0No colour.
TERM, CIColour is on for a terminal if TERM is set and isn't dumb, or if CLICOLOR or CI is set. Live progress needs a terminal and a TERM that isn't dumb.
LC_ALL, LC_CTYPE, LANGThe first one that is set decides whether cairn uses Unicode symbols. It must name UTF-8.

The rules for combining these are in Output and scripting.

Variables cairn reads from your session ​

VariableUsed for
HOMEA fallback for finding your systemd user unit directory.
XDG_CONFIG_HOMEIf it's set to an absolute path, cairn writes the systemd units for start-at-boot apps to $XDG_CONFIG_HOME/systemd/user. Otherwise it uses ~/.config/systemd/user.
XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESSHow cairn talks to your systemd user manager (systemctl --user). Without a session, the systemd launcher is unavailable, and cairn doctor says so.
NOTIFY_SOCKETSet by systemd when it starts a VM's supervisor, so the supervisor can report that it started. Never set it yourself.
PATHWhere cairn finds podman, git, curl and similar tools. cairn run removes the synced folder's directories from it first (see Run an agent).

Where your data is kept ​

An installed cairn always keeps your data in ~/.cairn, where ~ is your home directory from /etc/passwd. Each user has exactly one. There's no setting to move it. The layout is described in Files and directories.

Inside the VM ​

None of the variables above are passed to your app. For cairn run, -e and an agent alias's env list choose which variables are passed in (see Run an agent).

Inside an exec health check, cairn sets CAIRN_CHECK_ADDR to the address the http and tcp checks use.

Variables for developers and tests

These are for cairn's own tests. Don't set them on a normal install.

  • CAIRN_HOME is only read by a debug build from a source checkout, where it replaces ~/.cairn.
  • CAIRN_JAIL, CAIRN_NETD and CAIRN_HELPER replace the paths of the helper programs, so that tests can run stand-ins. A normal install always uses /usr/libexec/cairn, and there's no setting for that. The systemd units cairn writes copy these three variables if they're set.
  • Any variable named CAIRN_TEST_*, CAIRN_*_TEST_* or CAIRN_UPDATE_GOLDEN is a test hook, and isn't supported.

See Development.