Operating a box
Durability, updates, and rotating the connect token.
Reboot & crash survival
- Docker installs run with
--restart unless-stopped— Docker brings the container back after a reboot or crash. - Native installs register a systemd service (
Restart=always) when systemd is available, so the box survives reboots and restarts if a component dies. The launcher supervises all three processes (daemon, Caddy, agent) and exits as a unit if any one fails, so you never get a half-up box. - Where systemd isn't available, native runs as a foreground process that does
not survive a reboot — run
motion startagain after one.
Check which you have with motion status (it prints systemd or nohup).
Updating
motion updateChecks the hub's current version for your platform and updates in place if it's
newer — downloading to a temp dir and atomically swapping only on success.
motion doctor also surfaces "update available".
State (sessions, scheduler) is versioned: if a new build changes the on-disk format, the old state is archived and recreated rather than crash-looping — your files are never touched, only session/scheduler history.
Rotating the connect token
A connect token is a long-lived bearer credential. If one leaks, rotate it:
- In the dashboard, open the workspace's connect command and click Regenerate token. The old token stops working immediately, and the box must reconnect with the new one.
Tokens are 256-bit, compared in constant time, and ride an Authorization
header (not the URL) so they stay out of access logs. On native installs the
token is stored in ~/.motion/motion.env with 0600 permissions.
Reconnecting
If a box goes offline, just re-run the connect one-liner (or motion start if
it's installed) — it stops any prior run and reconnects. The hub detects a dead
box within ~50s via heartbeat, so the dashboard's online/offline status reflects
reality.