Architecture
KERSIST is deliberately small. It adds a systemd unit, a per-session configuration file, and a tiny supervisor that knows how to rebuild the workspace.
Components
KERSIST CLI ── kersist create/attach/start/stop/restart/drop
|
| writes /var/lib/kersist/NAME.json
| starts kersist@NAME.service
v
kersist@NAME.service (system-level systemd unit)
|
v
KERSIST supervisor (one small process per session)
|
v
tmux server + session NAME
|
v
your shell, editor, dev server, long-running process
What is stored
For each session, KERSIST stores a small JSON configuration at /var/lib/kersist/NAME.json: the session's working directory, the layout of windows and panes, and the command running in each pane. The session then runs as the owner of that file — not as root.
Intentional vs unexpected
- Intentional —
kersist stop, exiting the last pane, ortmux kill-session— is a fact recorded on disk. The session is not restarted. - Unexpected — the tmux server crashes, the machine reboots, the session process is killed — is a failure. The supervisor process inside
kersist@NAME.servicereplays the saved configuration and the original commands, and the tmux session returns.
That is the entire semantic distinction KERSIST adds. tmux gives you a workspace; KERSIST decides — explicitly — whether it continues to exist.
What this site runs on
This website is itself a demonstration of KERSIST. On each KERSIST server, a tmux session named kersist-web is managed by KERSIST — its web process is recreated after crashes and reboots, exactly like the sessions described here. A reverse proxy in front terminates HTTPS and forwards to the identical backend on two hosts, with automatic failover.