carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1# The protected view of the instance data tree (isolated-exec design §3.2).
2#
3# /data/.instances is the RAW directory, opened by the layout pass only;
4# this bind of it onto /data/instances is the view everything else uses.
5# nosymfollow is the isolation's belt: path resolution under this mount
6# returns ELOOP at any symlink, for every process on the box, in every
7# namespace that sees the mount, with no check-then-use race. An instance
8# runs as the agent's uid and can write its own directory, so any symlink
9# it plants would otherwise be followed by the agent (reading a sibling's
10# env file as this instance's), by the edge (dialling a sibling's socket
11# as this host) and by PID 1. Here none of them follow it.
12#
13# It is a bind of a DIFFERENT directory, not of itself, because rename(2)
14# refuses to cross a mount boundary (EXDEV) even on one filesystem, and
15# the migration moves /data/<host>.db into this tree by rename (codex R4-2).
16#
17# DefaultDependencies=no, with the ordering written out: a mount unit's
18# default place is before local-fs.target, and systemd-tmpfiles-setup,
19# which creates the two directories, runs after it, so the defaults form a
20# cycle systemd breaks by dropping this mount (codex R2-2). Shutdown
21# ordering is written out for the same reason.
22[Unit]
23Description=carlos instance data (bind, nosymfollow)
24DefaultDependencies=no
25RequiresMountsFor=/data
26After=local-fs.target systemd-tmpfiles-setup.service
27Before=carlos-edge.service carlos-instance-control.service carlos-litestream.service
28Conflicts=umount.target
29Before=umount.target
30
31[Mount]
32What=/data/.instances
33Where=/data/instances
34Type=none
35Options=bind,nosymfollow,nosuid,nodev,noexec
36
37[Install]
38WantedBy=multi-user.target
39