What this project has had to understand about Linux, beyond its manual: the points that changed a design or caused a failure. It is not a guide to Linux.
The sandbox
- Sessions run under
bwrapwith their own namespaces: the system read only, the workspace writable, the network shared. Its one call site is replaceable (precept I6 inPLAN.md). - What is not bound in does not exist. The served repository file is outside every sandbox, so a session with a file remote could sync only between turns (0160971667).
- A login directory is bound at
~/plus its name, read and write: ahomesentry of/var/lib/ocx/release/stagedappears as~/staged(e91c8acbcd). A session whose definition drops such an entry loses that login, as Codex did with/root/.codex(5ad49ff621). /etc/hostsand/etc/resolv.confare bound in, so names resolve inside the sandbox as on the host./tmpis the session's own and is emptied between turns. A file kept there for the next turn is gone; keep it in the workspace (877097e6b9).
Files and links
- A symbolic link can redirect any check made before a file is opened. A report path checked as inside the tree was swapped for a link to a file outside before it was read (877097e6b9).
/proc/self/fd/Nnames the file a handle actually opened, so a check made through it cannot be redirected (8ef3cd9765).
Processes
- Each session runs in its own process group, started by
setsid; the daemon stops a session by signalling the whole group, so nothing it started is left behind (72ce3dca69). A daemon that dies leaves its sessions running; one that re-executes itself in place keeps its pid and adopts them again (bc12df02a0). - A session started by another parent is left alone. The daemon refuses to launch beside a process it did not start, rather than kill it.