carlos / platform Public

instances: one SIGTERM per stop; Retire uses its own signal (#528)

Astra R1 P1: under control-group a forwarding trampoline gives the
tenant two SIGTERMs. Templates set CARLOS_INIT_STOP=cgroup so the init
drops its own SIGTERM; a claims-on Retire sends SIGPWR, which the init
passes on as one SIGTERM. Witness strengthened (drain marker, exact
count, fast exit, retire, cgroup events); runner 20261108T160744 PASS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4f7a8d207234f8b6818e8e2f83f2d42d228085db parent 5771a1c
25 files changed, +448 −138
  • docs/superpowers/notes/census-proposal-instance-stop-528.md +15 −15
  • docs/superpowers/specs/2026-11-08-instance-stop-privatepids-528-design.md +55 −38
  • internal/activator/claimretire_signal_linux_test.go +70 −0
  • internal/activator/claimwake.go +9 −1
  • internal/host/claimunit_template.go +1 −0
  • internal/host/instancestop_rootrunner_linux_test.go +104 −21
  • internal/host/units/carlos-instance-cmd@.service +4 −2
  • internal/host/units/carlos-instance-gen@.service +4 −2
  • internal/host/units/carlos-instance-rootfs-cmd@.service +4 −2
  • internal/host/units/carlos-instance-rootfs-gen@.service +4 −2
  • internal/host/units/carlos-instance-rootfs-tty@.service +4 −2
  • internal/host/units/carlos-instance-rootfs-worker@.service +4 −2
  • internal/host/units/carlos-instance-rootfs@.service +4 −2
  • internal/host/units/carlos-instance-seed@.service +4 −2
  • internal/host/units/carlos-instance-sidecar@.service +4 −2
  • internal/host/units/carlos-instance-tty@.service +4 −2
  • internal/host/units/carlos-instance@.service +4 −2
  • internal/host/units_privatepids_test.go +11 −0
  • internal/instancectl/initstop.go +12 −0
  • internal/instancectl/initstop_linux.go +12 −0
  • internal/instancectl/initstop_other.go +8 −0
  • internal/instanceexec/init_linux.go +28 −12
  • internal/instanceexec/init_test.go +49 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-instance-stop-528.tsv +29 −28

CI failed — run details

Intent

Attributed to this commit: 21.7 g CO₂e (2,652,666 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on instance-stop-528, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-proposal-instance-stop-528.md b/docs/superpowers/notes/census-proposal-instance-stop-528.md
index 37999c8ff..fb37ae4eb 100644
--- a/docs/superpowers/notes/census-proposal-instance-stop-528.md
+++ b/docs/superpowers/notes/census-proposal-instance-stop-528.md
@@ -4,20 +4,20 @@ Ruling `census-ruling-instance-stop-528`. The independent reviewer approves or r
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/host/claimunit_template.go` `const claimBoundTemplate` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528): at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-cmd@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-gen@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-cmd@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-gen@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-tty@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-worker@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-seed@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-sidecar@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-tty@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
-
-Envelopes re-pinned: `internal/activator`, `internal/host`, `internal/host/units`, `internal/instanceexec`.
+| `internal/host/claimunit_template.go` `const claimBoundTemplate` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos): at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-cmd@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-gen@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-rootfs-cmd@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-rootfs-gen@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-rootfs-tty@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-rootfs-worker@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-rootfs@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-seed@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-sidecar@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-tty@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance@.service` `external` | body | unchanged (1) | KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added |
+
+Envelopes re-pinned: `internal/activator`, `internal/host`, `internal/host/units`, `internal/instancectl`, `internal/instanceexec`.
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
@@ -36,6 +36,6 @@ Recorded dispositions, which each change must still satisfy:
- `internal/host/units/carlos-instance-tty@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates)
- `internal/host/units/carlos-instance@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates)
-Seal: `b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c` → `17fc610f0ce5fad7d423e433ffe86e3113a0f57074dfd699b4db2cb6d5d2bbe9`.
+Seal: `b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c` → `e7c0d40feb6a1cdf4926bee4d7e7465114a5b1b72093f8effb59cc79e860fb34`.
Overlay: `internal/provision/testdata/plan14-root-reads-instance-stop-528.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/specs/2026-11-08-instance-stop-privatepids-528-design.md b/docs/superpowers/specs/2026-11-08-instance-stop-privatepids-528-design.md
index 859a0b375..215b7728d 100644
--- a/docs/superpowers/specs/2026-11-08-instance-stop-privatepids-528-design.md
+++ b/docs/superpowers/specs/2026-11-08-instance-stop-privatepids-528-design.md
@@ -83,31 +83,45 @@ rootfs run, gen, worker, cmd and tty) and the claim-bound template in
Under `control-group` the SIGTERM phase also signals every other process in
the unit's cgroup. A running instance always has one, the app under the
trampoline, so `cg_kill_recursive()` reports a kill and systemd arms the
-`TimeoutStopSec=20` timer and waits, however the main-PID race went. The
-stop then ends as it was designed to:
-
-- the app drains on SIGTERM and exits;
-- the trampoline exits with the app's status, or 128+15 = 143, which
- `SuccessExitStatus=129 130 141 143` counts as clean;
-- anything still running after 20 s gets SIGKILL from systemd, as before.
-
-Nothing about isolation changes: same namespaces, same uid, same filters,
-same cgroup and the same bound on stop time.
-
-### What tenants see differently
-
-- **The app's own children get SIGTERM at stop**, as under systemd's default
- `KillMode`, instead of SIGKILL once the app has exited. The caps renderer
- already gives "children" apps `KillMode=control-group` for the same
- reason.
-- **The app can see SIGTERM twice**: once from systemd directly and once
- forwarded by the trampoline. Both arrive within microseconds, and a
- standard signal still pending when the second arrives is merged with the
- first. Handlers in common runtimes are idempotent (Go's `signal.Notify`
- drops into a full channel, Node's server close is a no-op the second time,
- Python's and PHP's default action is to exit). The trampoline keeps
- forwarding because some SIGTERMs reach only the main process, for example
- a claims-on generation's `Retire`, which signals the unit's main PID.
+`TimeoutStopSec=20` timer and waits, however the main-PID race went.
+
+### The trampoline sends no second SIGTERM
+
+The trampoline used to forward the SIGTERM it got as the main process. Under
+`control-group` that would give the app two: systemd's own and the
+forwarded one. A Go app that calls `NotifyContext`'s `stop` on the first
+(restoring the default action) would then die mid-drain on the second
+(Astra R1). Forwarding also reopens the race above: if the trampoline
+forwards and the app exits before systemd's cgroup scan reaches it, the scan
+finds nothing and systemd SIGKILLs the trampoline at once.
+
+So each template sets `Environment=CARLOS_INIT_STOP=cgroup` beside
+`KillMode=control-group`. With it, the trampoline drops a SIGTERM aimed at
+itself: the stop's SIGTERM reaches the app only from systemd, during the
+scan, so the app is alive when the scan finds it and gets exactly one. The
+variable reaches the trampoline only; the app's environment is still its
+launch file's.
+
+One sender signals the main process alone: a claims-on generation's
+`Retire` (root launch), which asks the app to drain before the unit stops.
+It now sends `instancectl.RetireSignal` (SIGPWR), which the trampoline turns
+into one SIGTERM for the app in either mode. A launch the agent holds itself
+still gets SIGTERM.
+
+Rolls mix versions for a moment. A trampoline from before this change in a
+new unit forwards as before (two SIGTERMs, today's mixed-era behaviour); a
+new trampoline under an old `mixed` unit has no `CARLOS_INIT_STOP` and
+forwards as before; an old trampoline drops SIGPWR (no handler, PID 1), so a
+`Retire` falls back to the unit stop's SIGTERM after its grace.
+
+The stop then ends as designed: the app drains and exits; the trampoline
+exits with the app's status, or 143, which `SuccessExitStatus=` counts as
+clean; anything still running after 20 s gets SIGKILL. Nothing about
+isolation changes: same namespaces, uid, filters, cgroup and stop bound.
+
+The app's own children now get SIGTERM at stop, as under systemd's default
+`KillMode`, instead of SIGKILL once the app has exited. The caps renderer
+already gives "children" apps `KillMode=control-group` for the same reason.
### Demos never outlive their time
@@ -126,20 +140,23 @@ SIGTERM.
`PrivatePIDs=yes`. A unit with no `KillMode=` line gets systemd's
default, `control-group`; the probes rely on that. The existing
per-template pins move from `mixed` to `control-group`.
+- **Trampoline (unit tests):** under `CARLOS_INIT_STOP=cgroup` a SIGTERM to
+ the init is not forwarded and the retire signal arrives as SIGTERM; without
+ it the retire signal still arrives as SIGTERM. `Retire` sends the retire
+ signal for a root launch and SIGTERM otherwise.
- **Real-box witness (root runner, `rootrunner` tag):**
- `TestRootInstanceStopUnderPrivatePIDs`. It installs the embedded
- `carlos-instance@.service`, with only its `[Unit]` couplings removed and a
- test name, so every `[Service]` line ships as written. The real trampoline
- runs, because the rootrunner `TestMain` dispatches `instance-exec` and
- `instance-exit`. The test:
- 1. runs the same start-and-stop cycle many times with `KillMode=mixed`
- restored by drop-in, and requires at least one `Result=signal` with a
- "not our child" line, which proves the race reproduces on the runner;
- 2. runs the cycle as many times on the shipped template, and requires
- `Result=success` every time and that the app saw SIGTERM;
- 3. stops an app that ignores SIGTERM, with `TimeoutStopSec=` shortened by
- drop-in, and requires that it is killed within the bound and that its
- cgroup is empty.
+ `TestRootInstanceStopUnderPrivatePIDs` installs the embedded
+ `carlos-instance@.service` with only its `[Unit]` couplings removed and runs
+ the real trampoline. It requires: with the pre-#528 template restored by
+ drop-in (`mixed`, no `CARLOS_INIT_STOP`), at least one alien start ending
+ `Result=signal`; with the shipped template, 40 draining stops and 40
+ fast-exit stops all `Result=success`, exit 0, exactly one SIGTERM each,
+ alien starts included; a retire signal to the main PID draining the app on
+ one SIGTERM; an app that ignores SIGTERM killed within `TimeoutStopSec=3`;
+ and every unit's cgroup gone or unpopulated after its stop.
+ Root runner 20261108T160744-e76dbf: PASS (mixed 3/40 alien, 3/40 signal;
+ control-group 4/40 alien, fast exit 4/40 alien, all success, one SIGTERM
+ each; ignore case killed at 3.3 s).
## Out of scope (recorded on #528)
diff --git a/internal/activator/claimretire_signal_linux_test.go b/internal/activator/claimretire_signal_linux_test.go
new file mode 100644
index 000000000..15882ef72
--- /dev/null
+++ b/internal/activator/claimretire_signal_linux_test.go
@@ -0,0 +1,70 @@
+//go:build linux
+
+package activator
+
+import (
+ "context"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "strings"
+ "testing"
+ "time"
+)
+
+// A root launch's Retire signals the unit's trampoline with the retire
+// signal, which the trampoline turns into the tenant's one SIGTERM; a bare
+// SIGTERM would be dropped under KillMode=control-group (#528). A launch the
+// agent holds itself still gets SIGTERM.
+func TestClaimRetireSignalsByLaunchKind(t *testing.T) {
+ for _, tc := range []struct {
+ name string
+ root bool
+ want string
+ }{{"root", true, "PWR"}, {"agent", false, "TERM"}} {
+ t.Run(tc.name, func(t *testing.T) {
+ got := filepath.Join(t.TempDir(), "got")
+ child := exec.Command("sh", "-c", `trap 'echo PWR >"$0"; exit 0' PWR; trap 'echo TERM >"$0"; exit 0' TERM; : >"$0.up"; while :; do sleep 0.02; done`, got)
+ if err := child.Start(); err != nil {
+ t.Skip("no sh:", err)
+ }
+ reaped := make(chan struct{})
+ go func() { _ = child.Wait(); close(reaped) }()
+ t.Cleanup(func() { _ = child.Process.Kill(); <-reaped })
+ for deadline := time.Now().Add(5 * time.Second); ; {
+ if _, err := os.Stat(got + ".up"); err == nil {
+ break
+ }
+ if time.Now().After(deadline) {
+ t.Fatal("child never set its traps")
+ }
+ time.Sleep(10 * time.Millisecond)
+ }
+ var p *claimProcess
+ if tc.root {
+ start, err := roleProcessStart(child.Process.Pid)
+ if err != nil {
+ t.Fatal(err)
+ }
+ proc, err := pinRootProcess(child.Process.Pid, start)
+ if err != nil {
+ t.Fatal(err)
+ }
+ p = newClaimProcessFor(&exec.Cmd{Process: proc}, nil, true)
+ p.settle = func(context.Context) error { return nil }
+ } else {
+ p = newClaimProcess(nil, nil)
+ p.cmd = child
+ p.done = reaped
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ defer cancel()
+ _ = p.Retire(ctx, 3*time.Second)
+ <-reaped
+ b, err := os.ReadFile(got)
+ if err != nil || strings.TrimSpace(string(b)) != tc.want {
+ t.Fatalf("retire delivered %q (%v), want %s", b, err, tc.want)
+ }
+ })
+ }
+}
diff --git a/internal/activator/claimwake.go b/internal/activator/claimwake.go
index ba886852a..809d15ee5 100644
--- a/internal/activator/claimwake.go
+++ b/internal/activator/claimwake.go
@@ -16,6 +16,7 @@ import (
"github.com/carlosframework/platform/internal/hostbox"
"github.com/carlosframework/platform/internal/hostclaim"
"github.com/carlosframework/platform/internal/hostwrite"
+ "github.com/carlosframework/platform/internal/instancectl"
"github.com/carlosframework/platform/internal/moves"
"github.com/carlosframework/platform/internal/provision"
"github.com/carlosframework/platform/internal/registry"
@@ -826,7 +827,14 @@ func (p *claimProcess) Stop(ctx context.Context) error {
// ready is not retired: its owner Stops it, which kills at once.
func (p *claimProcess) Retire(ctx context.Context, grace time.Duration) error {
if p.cmd != nil && p.cmd.Process != nil && !p.Exited() {
- err := p.cmd.Process.Signal(syscall.SIGTERM)
+ // A root launch's process is its unit's trampoline, which passes
+ // the retire signal on to the tenant as a SIGTERM and drops a bare
+ // SIGTERM under KillMode=control-group (#528).
+ sig := os.Signal(syscall.SIGTERM)
+ if p.root {
+ sig = instancectl.RetireSignal
+ }
+ err := p.cmd.Process.Signal(sig)
switch {
case err == nil, errors.Is(err, os.ErrProcessDone):
t := time.NewTimer(grace)
diff --git a/internal/host/claimunit_template.go b/internal/host/claimunit_template.go
index 8fdfa3e38..32d5508cd 100644
--- a/internal/host/claimunit_template.go
+++ b/internal/host/claimunit_template.go
@@ -14,6 +14,7 @@ Group=carlos
Slice=carlos-instances-%i.slice
Restart=no
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
SuccessExitStatus=129 130 141 143
StandardOutput=file:/run/carlos/logs/%I.run.sock
diff --git a/internal/host/instancestop_rootrunner_linux_test.go b/internal/host/instancestop_rootrunner_linux_test.go
index 0bd297b90..df141181a 100644
--- a/internal/host/instancestop_rootrunner_linux_test.go
+++ b/internal/host/instancestop_rootrunner_linux_test.go
@@ -28,27 +28,44 @@ const instanceStopTenantArg = "instance-stop-tenant"
// instanceStopTenant is the app inside the witness unit, under the real
// trampoline. It writes "up" once its SIGTERM handler is in place and
-// appends a line to "terms" for every SIGTERM it gets. In the default mode
-// it drains for 200 ms and exits 0; with STOPWIT_MODE=ignore it never
-// exits on its own, so only systemd's SIGKILL ends it.
+// appends a line to "terms" for every SIGTERM it gets. STOPWIT_MODE picks
+// what a SIGTERM does: "drain" keeps counting SIGTERMs for 300 ms, writes
+// "drained" and exits 0; "fast" exits 0 at once; "ignore" never exits on
+// its own, so only systemd's SIGKILL ends it.
func instanceStopTenant() {
sigs := make(chan os.Signal, 8)
signal.Notify(sigs, syscall.SIGTERM)
if err := os.WriteFile("up", []byte(strconv.Itoa(os.Getpid())), 0o644); err != nil {
os.Exit(3)
}
- ignore := os.Getenv("STOPWIT_MODE") == "ignore"
- for range sigs {
+ term := func() {
f, err := os.OpenFile("terms", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o644)
if err == nil {
_, _ = f.WriteString("term\n")
_ = f.Close()
}
- if !ignore {
- time.Sleep(200 * time.Millisecond)
- os.Exit(0)
+ }
+ mode := os.Getenv("STOPWIT_MODE")
+ <-sigs
+ term()
+ switch mode {
+ case "fast":
+ os.Exit(0)
+ case "drain":
+ drain := time.After(300 * time.Millisecond)
+ for {
+ select {
+ case <-sigs:
+ term()
+ case <-drain:
+ _ = os.WriteFile("drained", nil, 0o644)
+ os.Exit(0)
+ }
}
}
+ for range sigs {
+ term()
+ }
}
// TestRootInstanceStopUnderPrivatePIDs is #528's real-box witness. It
@@ -59,8 +76,11 @@ func instanceStopTenant() {
//
// 1. KillMode=mixed restored by drop-in: the race reproduces. Some starts
// log "not our child", and those stops end Result=signal.
-// 2. The shipped template: every stop ends Result=success with the tenant
-// having seen SIGTERM, including the starts that logged "not our child".
+// 2. The shipped template: every stop ends Result=success, main exit 0,
+// with the tenant having drained after exactly one SIGTERM, including
+// the starts that logged "not our child"; the same for a tenant that
+// exits the moment SIGTERM arrives; and a retire signal to the main
+// process alone reaches the tenant as one SIGTERM.
// 3. A tenant that ignores SIGTERM, TimeoutStopSec=3 by drop-in: the stop
// SIGKILLs it within the bound and leaves no process behind.
//
@@ -242,13 +262,17 @@ func TestRootInstanceStopUnderPrivatePIDs(t *testing.T) {
type outcome struct {
result, mainCode, mainStatus string
- alien bool
+ alien, drained bool
terms int
stop time.Duration
}
+ // ExecMainCode is a CLD_* number: 2 killed, 3 dumped. A clean exit
+ // reads 1, or 0 once the unit has gone inactive on systemd 257.
+ killedOrDumped := func(code string) bool { return code == "2" || code == "3" }
+ var signalMain func(pid string)
cycle := func() outcome {
t.Helper()
- for _, f := range []string{"up", "terms"} {
+ for _, f := range []string{"up", "terms", "drained"} {
_ = os.Remove(filepath.Join(data, f))
}
_, _ = ctl("reset-failed", unit)
@@ -269,8 +293,16 @@ func TestRootInstanceStopUnderPrivatePIDs(t *testing.T) {
}
time.Sleep(20 * time.Millisecond)
}
+ cg := must("show", "-p", "ControlGroup", "--value", unit)
+ if cg == "" {
+ t.Fatal("running unit has no ControlGroup")
+ }
began := time.Now()
- must("stop", unit)
+ if signalMain != nil {
+ signalMain(must("show", "-p", "MainPID", "--value", unit))
+ } else {
+ must("stop", unit)
+ }
o := outcome{stop: time.Since(began)}
o.result = must("show", "-p", "Result", "--value", unit)
o.mainCode = must("show", "-p", "ExecMainCode", "--value", unit)
@@ -278,6 +310,9 @@ func TestRootInstanceStopUnderPrivatePIDs(t *testing.T) {
if b, err := os.ReadFile(filepath.Join(data, "terms")); err == nil {
o.terms = strings.Count(string(b), "term\n")
}
+ if _, err := os.Stat(filepath.Join(data, "drained")); err == nil {
+ o.drained = true
+ }
// The "not our child" line is logged at start; journald may lag.
for i := 0; i < 20; i++ {
out, _ := exec.Command("journalctl", "-o", "cat", "--no-pager", "_PID=1", "INVOCATION_ID="+inv).CombinedOutput()
@@ -290,11 +325,14 @@ func TestRootInstanceStopUnderPrivatePIDs(t *testing.T) {
}
time.Sleep(50 * time.Millisecond)
}
- // An inactive unit has no ControlGroup; its cgroup directory, by the
- // name the slice gives it, must be gone or empty.
- cg := filepath.Join("/sys/fs/cgroup", strings.TrimPrefix(must("show", "-p", "ControlGroup", "--value", instancectl.SliceName(host)), "/"), unit, "cgroup.procs")
- if p, err := os.ReadFile(cg); err == nil && strings.TrimSpace(string(p)) != "" {
- t.Fatalf("processes left after stop in %s: %s", cg, p)
+ // The cgroup the unit ran in, read while it ran: gone, or empty.
+ events, err := os.ReadFile(filepath.Join("/sys/fs/cgroup", cg, "cgroup.events"))
+ switch {
+ case errors.Is(err, fs.ErrNotExist):
+ case err != nil:
+ t.Fatalf("cgroup %s after stop: %v", cg, err)
+ case !strings.Contains(string(events), "populated 0"):
+ t.Fatalf("cgroup %s still populated after stop: %s", cg, events)
}
return o
}
@@ -303,7 +341,8 @@ func TestRootInstanceStopUnderPrivatePIDs(t *testing.T) {
// 1. The old KillMode: the race reproduces here.
launch("drain")
- dropIn("50-mixed.conf", "KillMode=mixed")
+ // The template before #528: mixed, and an init that forwards SIGTERM.
+ dropIn("50-mixed.conf", "KillMode=mixed\nUnsetEnvironment="+instancectl.InitStopEnv)
var mixedAlien, mixedSignal int
for i := 0; i < n; i++ {
o := cycle()
@@ -333,7 +372,7 @@ func TestRootInstanceStopUnderPrivatePIDs(t *testing.T) {
if o.terms > maxTerms {
maxTerms = o.terms
}
- if o.result != "success" || o.terms == 0 {
+ if o.result != "success" || killedOrDumped(o.mainCode) || o.mainStatus != "0" || o.terms != 1 || !o.drained {
t.Errorf("control-group cycle %d: %+v", i, o)
}
}
@@ -342,10 +381,54 @@ func TestRootInstanceStopUnderPrivatePIDs(t *testing.T) {
t.Fatalf("no start was alien in %d control-group cycles: the fix was not exercised against the race", n)
}
+ // 2b. A tenant that exits the moment SIGTERM arrives.
+ launch("fast")
+ var fastAlien int
+ for i := 0; i < n; i++ {
+ o := cycle()
+ if o.alien {
+ fastAlien++
+ }
+ if o.result != "success" || killedOrDumped(o.mainCode) || o.mainStatus != "0" || o.terms != 1 {
+ t.Errorf("fast-exit cycle %d: %+v", i, o)
+ }
+ }
+ t.Logf("verdict: fast exit: %d/%d alien, all Result=success unless an error above", fastAlien, n)
+
+ // 2c. A retire signal to the main process alone: the tenant drains on
+ // one SIGTERM and the unit ends by itself.
+ launch("drain")
+ signalMain = func(pid string) {
+ t.Helper()
+ n, err := strconv.Atoi(pid)
+ if err != nil || n <= 1 {
+ t.Fatalf("MainPID %q", pid)
+ }
+ if err := syscall.Kill(n, instancectl.RetireSignal); err != nil {
+ t.Fatal(err)
+ }
+ deadline := time.Now().Add(10 * time.Second)
+ for {
+ if s, _ := ctl("show", "-p", "ActiveState", "--value", unit); s == "inactive" || s == "failed" {
+ return
+ }
+ if time.Now().After(deadline) {
+ t.Fatal("unit did not end after the retire signal")
+ }
+ time.Sleep(20 * time.Millisecond)
+ }
+ }
+ o := cycle()
+ signalMain = nil
+ t.Logf("verdict: retire signal: %+v", o)
+ if o.result != "success" || killedOrDumped(o.mainCode) || o.mainStatus != "0" || o.terms != 1 || !o.drained {
+ t.Errorf("retire signal did not drain the tenant on one SIGTERM: %+v", o)
+ }
+
// 3. A tenant that ignores SIGTERM is still killed within the bound.
launch("ignore")
dropIn("50-short.conf", "TimeoutStopSec=3")
- o := cycle()
+ o = cycle()
undrop("50-short.conf")
t.Logf("verdict: ignore-SIGTERM stop: %+v", o)
if o.terms == 0 || o.stop < 3*time.Second || o.stop > 10*time.Second || o.result != "timeout" {
diff --git a/internal/host/units/carlos-instance-cmd@.service b/internal/host/units/carlos-instance-cmd@.service
index e62e58fb0..b6b517b73 100644
--- a/internal/host/units/carlos-instance-cmd@.service
+++ b/internal/host/units/carlos-instance-cmd@.service
@@ -33,9 +33,11 @@ Slice=carlos-instances-%i.slice
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# No SuccessExitStatus=: the agent reads the exit status itself.
# Two listeners, so stdout and stderr stay apart (run spec §5.5). PID 1
diff --git a/internal/host/units/carlos-instance-gen@.service b/internal/host/units/carlos-instance-gen@.service
index dc47f8023..6070fd16d 100644
--- a/internal/host/units/carlos-instance-gen@.service
+++ b/internal/host/units/carlos-instance-gen@.service
@@ -36,9 +36,11 @@ Restart=no
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# The main process is the trampoline, which stays as the namespace's init
# and runs the app as its child (#126): it forwards the SIGTERM and exits
diff --git a/internal/host/units/carlos-instance-rootfs-cmd@.service b/internal/host/units/carlos-instance-rootfs-cmd@.service
index ba50eeec0..5e66e33fc 100644
--- a/internal/host/units/carlos-instance-rootfs-cmd@.service
+++ b/internal/host/units/carlos-instance-rootfs-cmd@.service
@@ -36,9 +36,11 @@ Slice=carlos-instances-%i.slice
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# No SuccessExitStatus=: the agent reads the exit status itself.
# Two listeners, so stdout and stderr stay apart (run spec §5.5). PID 1
diff --git a/internal/host/units/carlos-instance-rootfs-gen@.service b/internal/host/units/carlos-instance-rootfs-gen@.service
index 4a5b115eb..32f3b71bc 100644
--- a/internal/host/units/carlos-instance-rootfs-gen@.service
+++ b/internal/host/units/carlos-instance-rootfs-gen@.service
@@ -40,9 +40,11 @@ Restart=no
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# The main process is the trampoline, which stays as the namespace's init
# and runs the app as its child (#126): it forwards the SIGTERM and exits
diff --git a/internal/host/units/carlos-instance-rootfs-tty@.service b/internal/host/units/carlos-instance-rootfs-tty@.service
index e98d56554..6796e0d92 100644
--- a/internal/host/units/carlos-instance-rootfs-tty@.service
+++ b/internal/host/units/carlos-instance-rootfs-tty@.service
@@ -35,9 +35,11 @@ Slice=carlos-instances-%i.slice
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# No SuccessExitStatus=: the agent reads the exit status itself.
# One socket, the agent's: PID 1 connects stdin to it as root, outside the
diff --git a/internal/host/units/carlos-instance-rootfs-worker@.service b/internal/host/units/carlos-instance-rootfs-worker@.service
index f71d2b9ef..9e8e64e78 100644
--- a/internal/host/units/carlos-instance-rootfs-worker@.service
+++ b/internal/host/units/carlos-instance-rootfs-worker@.service
@@ -50,9 +50,11 @@ Restart=no
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# The main process is the trampoline, which stays as the namespace's init
# and runs the worker as its child (#126): it forwards the SIGTERM and
diff --git a/internal/host/units/carlos-instance-rootfs@.service b/internal/host/units/carlos-instance-rootfs@.service
index 4e8650fef..656a708be 100644
--- a/internal/host/units/carlos-instance-rootfs@.service
+++ b/internal/host/units/carlos-instance-rootfs@.service
@@ -46,9 +46,11 @@ Restart=no
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# The main process is the trampoline, which stays as the namespace's init
# and runs the app as its child (#126): it forwards the SIGTERM and exits
diff --git a/internal/host/units/carlos-instance-seed@.service b/internal/host/units/carlos-instance-seed@.service
index 4f5e252ac..d3da9d11f 100644
--- a/internal/host/units/carlos-instance-seed@.service
+++ b/internal/host/units/carlos-instance-seed@.service
@@ -43,9 +43,11 @@ Slice=carlos-instances-%i.slice
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# No SuccessExitStatus= here, unlike the run and sidecar templates (#126):
# the trampoline's init reports a seed a signal ended as 128+n, and a seed
diff --git a/internal/host/units/carlos-instance-sidecar@.service b/internal/host/units/carlos-instance-sidecar@.service
index 558a95cf7..f26ad87a5 100644
--- a/internal/host/units/carlos-instance-sidecar@.service
+++ b/internal/host/units/carlos-instance-sidecar@.service
@@ -39,9 +39,11 @@ Restart=no
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# The main process is the trampoline, which stays as the namespace's init
# and runs the app as its child (#126): it forwards the SIGTERM and exits
diff --git a/internal/host/units/carlos-instance-tty@.service b/internal/host/units/carlos-instance-tty@.service
index b0a960c5f..6bfbdc46f 100644
--- a/internal/host/units/carlos-instance-tty@.service
+++ b/internal/host/units/carlos-instance-tty@.service
@@ -33,9 +33,11 @@ Slice=carlos-instances-%i.slice
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# No SuccessExitStatus=: the agent reads the exit status itself.
# One socket, the agent's: PID 1 connects stdin to it as root, outside the
diff --git a/internal/host/units/carlos-instance@.service b/internal/host/units/carlos-instance@.service
index 44ea4bfcd..a181e9066 100644
--- a/internal/host/units/carlos-instance@.service
+++ b/internal/host/units/carlos-instance@.service
@@ -39,9 +39,11 @@ Restart=no
# (#528): under PrivatePIDs= systemd sometimes takes the main process for
# "not our child", and then a mixed stop, which sends its SIGTERM to the
# main process alone, has nothing to wait on and SIGKILLs at once. Here
-# the SIGTERM reaches the tenant directly as well, so there is always
-# something to wait on.
+# the SIGTERM reaches the tenant directly, so there is something to wait
+# on, and the trampoline, told so by the line below, forwards none of its
+# own: the tenant gets exactly one SIGTERM.
KillMode=control-group
+Environment=CARLOS_INIT_STOP=cgroup
TimeoutStopSec=20
# The main process is the trampoline, which stays as the namespace's init
# and runs the app as its child (#126): it forwards the SIGTERM and exits
diff --git a/internal/host/units_privatepids_test.go b/internal/host/units_privatepids_test.go
index 78ca899ce..57e1881bf 100644
--- a/internal/host/units_privatepids_test.go
+++ b/internal/host/units_privatepids_test.go
@@ -4,6 +4,8 @@ import (
"io/fs"
"strings"
"testing"
+
+ "github.com/carlosframework/platform/internal/instancectl"
)
// TestPrivatePIDsUnitsKillControlGroup is #528's invariant. Under
@@ -38,10 +40,19 @@ func TestPrivatePIDsUnitsKillControlGroup(t *testing.T) {
continue
}
checked++
+ trampoline := false
for _, d := range directives(u) {
if strings.HasPrefix(d, "KillMode=") && d != "KillMode=control-group" {
t.Errorf("%s: %s beside PrivatePIDs=yes: an alien main PID makes every stop a SIGKILL (#528)", name, d)
}
+ if strings.HasPrefix(d, "ExecStart=") && strings.Contains(d, " instance-exec ") {
+ trampoline = true
+ }
+ }
+ // The trampoline must know the stop reaches its tenant directly, or
+ // the tenant gets the stop's SIGTERM twice.
+ if trampoline && !hasDirective(u, "Environment="+instancectl.InitStopEnv+"="+instancectl.InitStopCgroup) {
+ t.Errorf("%s runs the trampoline under control-group without %s=%s", name, instancectl.InitStopEnv, instancectl.InitStopCgroup)
}
}
// Eleven tenant templates (run, gen, seed, sidecar, cmd and tty, and the
diff --git a/internal/instancectl/initstop.go b/internal/instancectl/initstop.go
new file mode 100644
index 000000000..2dcade580
--- /dev/null
+++ b/internal/instancectl/initstop.go
@@ -0,0 +1,12 @@
+package instancectl
+
+// InitStopEnv is set by a tenant template, beside KillMode=control-group,
+// to tell the trampoline (instance-exec's init) that a unit stop signals
+// the tenant directly (#528): the init then forwards no SIGTERM of its
+// own, so the tenant gets exactly one. Its value is InitStopCgroup. The
+// variable reaches the init only; the tenant's environment is its launch
+// file's.
+const (
+ InitStopEnv = "CARLOS_INIT_STOP"
+ InitStopCgroup = "cgroup"
+)
diff --git a/internal/instancectl/initstop_linux.go b/internal/instancectl/initstop_linux.go
new file mode 100644
index 000000000..58383d5a4
--- /dev/null
+++ b/internal/instancectl/initstop_linux.go
@@ -0,0 +1,12 @@
+//go:build linux
+
+package instancectl
+
+import "syscall"
+
+// RetireSignal asks a trampoline to pass a SIGTERM to its tenant (#528).
+// Under InitStopCgroup the init drops a SIGTERM aimed at itself, because
+// a unit stop reaches the tenant directly; a signal for the init alone, a
+// claims-on generation's Retire, uses this one instead. An init from
+// before #528 has no handler for it and, as a namespace's PID 1, drops it.
+const RetireSignal = syscall.SIGPWR
diff --git a/internal/instancectl/initstop_other.go b/internal/instancectl/initstop_other.go
new file mode 100644
index 000000000..550de4e1d
--- /dev/null
+++ b/internal/instancectl/initstop_other.go
@@ -0,0 +1,8 @@
+//go:build !linux
+
+package instancectl
+
+import "syscall"
+
+// RetireSignal is SIGTERM where there is no trampoline (see initstop_linux.go).
+const RetireSignal = syscall.SIGTERM
diff --git a/internal/instanceexec/init_linux.go b/internal/instanceexec/init_linux.go
index 57f82e786..899465291 100644
--- a/internal/instanceexec/init_linux.go
+++ b/internal/instanceexec/init_linux.go
@@ -11,6 +11,8 @@ import (
"syscall"
"golang.org/x/sys/unix"
+
+ "github.com/carlosframework/platform/internal/instancectl"
)
// The trampoline stays behind as the namespace's init (#126, found on the
@@ -29,14 +31,19 @@ import (
// keeps its default actions exactly as on the flat layout, and does the
// two things PID 1 owes the namespace:
//
-// - Forward. A SIGTERM or other signal in forwarded that reaches this
-// process goes on to the tenant, which acts on it as it would have
-// as the main process. A unit stop (KillMode=control-group, #528)
-// signals the tenant directly too, so it may see that SIGTERM twice;
-// a claims-on generation's Retire signals this process alone, which
-// is why the forward stays. SIGKILL needs no forwarding: after
-// TimeoutStopSec systemd sends it to the whole cgroup, and SIGKILL
-// to a namespace init from outside always kills it.
+// - Forward. A signal in forwarded that reaches this process goes on
+// to the tenant, which acts on it as it would have as the main
+// process. One exception (#528): a template with
+// KillMode=control-group sets instancectl.InitStopEnv, because its
+// stop's SIGTERM reaches the tenant directly; this init then drops a
+// SIGTERM aimed at itself, so the tenant gets exactly one and a
+// handler that restores the default on the first (Go's NotifyContext
+// stop) is never killed mid-drain by a second. A signal for the init
+// alone, a claims-on generation's Retire, is instancectl.RetireSignal,
+// which goes on to the tenant as a SIGTERM in either mode. SIGKILL
+// needs no forwarding: after TimeoutStopSec systemd sends it to the
+// whole cgroup, and SIGKILL to a namespace init from outside always
+// kills it.
// - Reap. A process whose parent dies is reparented to the namespace's
// init, and stays a zombie until init waits for it. The tenant's own
// children that outlive their parent land here.
@@ -87,7 +94,8 @@ func runInitChecked(argv0 string, argv, env []string, stdio []*os.File, ctty boo
// Before anything can start the tenant: a stop that arrives early is
// queued and forwarded, not dropped by PID 1's missing defaults.
sigs := make(chan os.Signal, 32)
- signal.Notify(sigs, append(forwarded[:], syscall.SIGCHLD)...)
+ signal.Notify(sigs, append(forwarded[:], syscall.SIGCHLD, instancectl.RetireSignal)...)
+ directStop := os.Getenv(instancectl.InitStopEnv) == instancectl.InitStopCgroup
// Landlock restricts a thread, and a fork copies the forking thread's
// domain, which execve keeps: scoping this locked thread and forking
@@ -122,17 +130,25 @@ func runInitChecked(argv0 string, argv, env []string, stdio []*os.File, ctty boo
if err != nil {
return err
}
- os.Exit(superviseTenant(tenant, sigs))
+ os.Exit(superviseTenant(tenant, sigs, directStop))
return nil
}
// superviseTenant forwards signals to the tenant and reaps every child
// until the tenant itself is reaped, and returns the init's exit code.
-func superviseTenant(tenant int, sigs <-chan os.Signal) int {
+// directStop drops a SIGTERM aimed at the init: the unit's stop has sent
+// the tenant its own (#528). The retire signal becomes a SIGTERM.
+func superviseTenant(tenant int, sigs <-chan os.Signal, directStop bool) int {
var ws syscall.WaitStatus
for s := range sigs {
sig := s.(syscall.Signal)
- if sig != syscall.SIGCHLD {
+ switch {
+ case sig == instancectl.RetireSignal:
+ _ = syscall.Kill(tenant, syscall.SIGTERM)
+ continue
+ case sig == syscall.SIGTERM && directStop:
+ continue
+ case sig != syscall.SIGCHLD:
_ = syscall.Kill(tenant, sig)
continue
}
diff --git a/internal/instanceexec/init_test.go b/internal/instanceexec/init_test.go
index a63e5d512..1c149ad01 100644
--- a/internal/instanceexec/init_test.go
+++ b/internal/instanceexec/init_test.go
@@ -18,6 +18,8 @@ import (
"time"
"golang.org/x/sys/unix"
+
+ "github.com/carlosframework/platform/internal/instancectl"
)
// The init tests run the real runInit in a child process: this test
@@ -267,6 +269,53 @@ func TestInitForwardsEachSignal(t *testing.T) {
}
}
+// Under InitStopCgroup a unit stop signals the tenant directly, so the init
+// drops a SIGTERM aimed at itself (#528): the tenant gets exactly one. The
+// retire signal is the init's own way to pass a SIGTERM on.
+func TestInitDirectStopForwardsOnlyTheRetireSignal(t *testing.T) {
+ cmd, out := startInit(t, "echo-signals", nil, instancectl.InitStopEnv+"="+instancectl.InitStopCgroup)
+ if line := readLine(t, out, 10*time.Second); line != "ready" {
+ t.Fatalf("tenant said %q", line)
+ }
+ if err := cmd.Process.Signal(syscall.SIGTERM); err != nil {
+ t.Fatal(err)
+ }
+ time.Sleep(200 * time.Millisecond)
+ if err := cmd.Process.Signal(syscall.SIGUSR1); err != nil {
+ t.Fatal(err)
+ }
+ if line := readLine(t, out, 5*time.Second); line != "got "+syscall.SIGUSR1.String() {
+ t.Fatalf("after SIGTERM then SIGUSR1 the tenant said %q: the init forwarded the SIGTERM", line)
+ }
+ if err := cmd.Process.Signal(instancectl.RetireSignal); err != nil {
+ t.Fatal(err)
+ }
+ if line := readLine(t, out, 5*time.Second); line != "got "+syscall.SIGTERM.String() {
+ t.Errorf("retire signal: tenant said %q, want a SIGTERM", line)
+ }
+ if code, sig := waitExit(t, cmd, 5*time.Second); code != 0 {
+ t.Errorf("init exit = %d (signal %v), want the tenant's 0", code, sig)
+ }
+}
+
+// Without InitStopCgroup (a template from before #528) the retire signal
+// still reaches the tenant as a SIGTERM, as a forwarded SIGTERM does.
+func TestInitForwardsTheRetireSignalAsSIGTERM(t *testing.T) {
+ cmd, out := startInit(t, "echo-signals", nil)
+ if line := readLine(t, out, 10*time.Second); line != "ready" {
+ t.Fatalf("tenant said %q", line)
+ }
+ if err := cmd.Process.Signal(instancectl.RetireSignal); err != nil {
+ t.Fatal(err)
+ }
+ if line := readLine(t, out, 5*time.Second); line != "got "+syscall.SIGTERM.String() {
+ t.Errorf("retire signal: tenant said %q, want a SIGTERM", line)
+ }
+ if code, sig := waitExit(t, cmd, 5*time.Second); code != 0 {
+ t.Errorf("init exit = %d (signal %v), want the tenant's 0", code, sig)
+ }
+}
+
// A tenant with no handlers acts on a forwarded signal by its default
// disposition, as the main process did before PrivatePIDs: it dies by
// the signal, and the init reports 128+n.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index d641d020c..28be4fd18 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -127,4 +127,4 @@ plan14-root-reads-agent-login-link.tsv e820ef22ac677cd49aa9ca3f70d6bca9dea061bce
plan14-root-reads-fix-activator-backoff-flake.tsv feba66806ddfcbdfaf369d72413bb18e75162263b6f82f117fccf1b75497986a
plan14-root-reads-region-ha-dr5.tsv f19eb78c1da1475cbf8e11a3d6c394d828aa1c8f88ae24469fe8d473581b934b
plan14-root-reads-instance-syscall-filter.tsv b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c
-plan14-root-reads-instance-stop-528.tsv 17fc610f0ce5fad7d423e433ffe86e3113a0f57074dfd699b4db2cb6d5d2bbe9
+plan14-root-reads-instance-stop-528.tsv e7c0d40feb6a1cdf4926bee4d7e7465114a5b1b72093f8effb59cc79e860fb34
diff --git a/internal/provision/testdata/plan14-root-reads-instance-stop-528.tsv b/internal/provision/testdata/plan14-root-reads-instance-stop-528.tsv
index 95fdd5091..fce1f2dfa 100644
--- a/internal/provision/testdata/plan14-root-reads-instance-stop-528.tsv
+++ b/internal/provision/testdata/plan14-root-reads-instance-stop-528.tsv
@@ -1,29 +1,30 @@
# Census overlay instance-stop-528, written by census-propose (#369). census-ruling-instance-stop-528, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-instance-stop-528.md.
-# 12 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-@legacy b1549acb68a9895eef12f9c4578baba1f3a637df435396b3548c648f78c48c77 internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 df483336c1a9846eb48dba585ed2a690a6a6feebfccde4ac004bbb4640ee09e0
-@legacy d04dc5fa8c8fb1bc9a6684259104082512082f3c8da326c76d992a45242e63ae internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 22d1f3cd2e8c0242ed6131de1ffbfb4d3abb98ff04dd25a8c0dbfb8e17d9b304
-@legacy ce09c98072499106d8f45f03dc3c7e642302c1d3a7351e0a97a4feaeaba0058f internal/host/units/carlos-instance-rootfs-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-cmd@.service, accepted at census-ruling-carlos-run): new (rootfs Plan 2 Task 4): the rootfs cmd unit (oneshot, TimeoutStartSec=6h5m, the cmd log sockets), binding /run/carlos-control/exe/%I/rootfs/cmd/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 2ee448ac0f6b66a86ec494dd999f7ecfa1ff38bbf79a4e461864998bedeabfb2
-@legacy 31cb2ef306500f372dd8aa7f9dcb0d7c2d7d7f3e1df17451c8339bffb9ef3dbf internal/host/units/carlos-instance-rootfs-gen@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs generation's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (RootfsGenDropIn) supplies, so the template alone mounts and runs nothing. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 2ddb4351ce62f2e0256dc6816e40fbf8ad92bc4ea1329fd8e121c681b6841a49
-@legacy abcf6001a28d9754aee0cb24ffaee19c92e82b2e38be3a60b99baead9ef2f3b4 internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Task 6: POST /tty runtime=rootfs (startRootfsCmd with RoleTTY) starts it through Plan 2's rootfs one-shot path (preflight, validateStagedImage, ensureRootfsExe under rootfs/tty/, jit drop-in and owed reload, post-start MemoryDenyWriteExecute check); its files go only through removeRootfsUnitFiles (stopRootfs and cleanCmdExe with RoleTTY, the sweep);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 23e7f579faaa8a6905e93131a5710e1b3403539143f5adfe45763bc98d17bdf3
-@legacy a9f2dc69b16f8f641d875fd49b22423ef097fa01cd3d437420210b8e372f610c internal/host/units/carlos-instance-rootfs-worker@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs worker's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (WorkerDropIn) supplies. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 00d87704dc78b355c4f0305c07980b8fdaedab136f06a8390312faf04219162e
-@legacy d5c339c10a5e446277141d9523a852e369c8425ad225f0330a81ec720cc32759 internal/host/units/carlos-instance-rootfs@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance@.service): new (rootfs Plan 2 Task 4): the run unit of a rootfs instance (ExecStart= the trampoline with --rootfs run, ExecStopPost= instance-exit --rootfs run), Slice=carlos-instances-%i.slice, binding /run/carlos-control/exe/%I/rootfs/run/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 7e29839a079b86e7831cfb1b3bd3a884821b0ab02c8be06d0c6248a2501b4e17
-@legacy 05ee0f83ecc8991f02962423e2a4194ab81b0c31cc0ad35f218f0d56e4960337 internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 a14ea0a8fe0b9485cc1f54eb361e6a8b751509dde6bc6567c48293431d34ce1c
-@legacy 78bd0b5a739014d65bb8b952c829bcb7b5379b4599787cdac52de370c9fe91c9 internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 c9d1f3d2effba05aedaec4345b737d23a9dcb556a5878cb823642d20c1cd653b
-@legacy 1b5af26da2e0b2a4554aa9a530efee5abb4e7c2402316d13a15726c2dcd83865 internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 6ddddf299a82c49216e1f6ed51cd15ec35690090db5f73d1f80adf4a6d07edfb
-@legacy 29f9c742ca9b8f8ec6ec55e624326adc3129acf6ec66c5e6528b724c4e84c7f0 internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 097f0bfe74d4da9b88ebd0ddccca7279960d0bcca0af0fc43e03a65fa3e6be69
-internal/host/claimunit_template.go const claimBoundTemplate authority E2 PROPOSED E51: Root-only bound-unit template is held inside the claim renderer; ordinary bootstrap never enumerates or installs it.;rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528): at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added data-literal@27 4178ed023af125ec0aabe909f54e486a4a634c34a0a7231738a02b35b620f3ce
-internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 df483336c1a9846eb48dba585ed2a690a6a6feebfccde4ac004bbb4640ee09e0
-internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 22d1f3cd2e8c0242ed6131de1ffbfb4d3abb98ff04dd25a8c0dbfb8e17d9b304
-internal/host/units/carlos-instance-rootfs-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-cmd@.service, accepted at census-ruling-carlos-run): new (rootfs Plan 2 Task 4): the rootfs cmd unit (oneshot, TimeoutStartSec=6h5m, the cmd log sockets), binding /run/carlos-control/exe/%I/rootfs/cmd/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 2ee448ac0f6b66a86ec494dd999f7ecfa1ff38bbf79a4e461864998bedeabfb2
-internal/host/units/carlos-instance-rootfs-gen@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs generation's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (RootfsGenDropIn) supplies, so the template alone mounts and runs nothing. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 2ddb4351ce62f2e0256dc6816e40fbf8ad92bc4ea1329fd8e121c681b6841a49
-internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Task 6: POST /tty runtime=rootfs (startRootfsCmd with RoleTTY) starts it through Plan 2's rootfs one-shot path (preflight, validateStagedImage, ensureRootfsExe under rootfs/tty/, jit drop-in and owed reload, post-start MemoryDenyWriteExecute check); its files go only through removeRootfsUnitFiles (stopRootfs and cleanCmdExe with RoleTTY, the sweep);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 23e7f579faaa8a6905e93131a5710e1b3403539143f5adfe45763bc98d17bdf3
-internal/host/units/carlos-instance-rootfs-worker@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs worker's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (WorkerDropIn) supplies. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 00d87704dc78b355c4f0305c07980b8fdaedab136f06a8390312faf04219162e
-internal/host/units/carlos-instance-rootfs@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance@.service): new (rootfs Plan 2 Task 4): the run unit of a rootfs instance (ExecStart= the trampoline with --rootfs run, ExecStopPost= instance-exit --rootfs run), Slice=carlos-instances-%i.slice, binding /run/carlos-control/exe/%I/rootfs/run/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 7e29839a079b86e7831cfb1b3bd3a884821b0ab02c8be06d0c6248a2501b4e17
-internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 a14ea0a8fe0b9485cc1f54eb361e6a8b751509dde6bc6567c48293431d34ce1c
-internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 c9d1f3d2effba05aedaec4345b737d23a9dcb556a5878cb823642d20c1cd653b
-internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 6ddddf299a82c49216e1f6ed51cd15ec35690090db5f73d1f80adf4a6d07edfb
-internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group (#528), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 097f0bfe74d4da9b88ebd0ddccca7279960d0bcca0af0fc43e03a65fa3e6be69
-@coverage internal/activator 1f6f37a52bb4741e911dba1da43d4e55922fcb0e27a5c424becc53e6756824ad
-@coverage internal/host f880658adcf926ab9478f889df919668f30f8ece8d3b1edb6e60d81a83d2b25e
-@coverage internal/host/units ae14f1bd929ab044700d2dcc5ee49af944434ee57e5620cc4611bb8adba4428b
-@coverage internal/instanceexec e3ea578751785388927b7d610f90cb063276ba347bd8b3fb0a7c207368550249
+# 12 body, 0 sites, 5 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 5a6b74ed1a02335c7c9d0111f4f19ac8b240c0fed874a4ad6c9ce1090b6ad634 internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 b9b64d4f3b5237e7d457dfe8f85d7c3a078ebe7282e903838109f2fa17b6097e
+@legacy 01dd033db81b8ddc7abfe9b26cdd1f6db00cb8ed385d6f4a79d3dbc74080c748 internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 750392d965ef0f9289d1316d62fe9189c6c4f7e13977e720e8b2810a314be37e
+@legacy 29ac04dd348ecbfcc580b7f2913c1517bc7e2675eb81fccadc5ba370f26e203a internal/host/units/carlos-instance-rootfs-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-cmd@.service, accepted at census-ruling-carlos-run): new (rootfs Plan 2 Task 4): the rootfs cmd unit (oneshot, TimeoutStartSec=6h5m, the cmd log sockets), binding /run/carlos-control/exe/%I/rootfs/cmd/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 edf498d72c227f3360c900d25d279cb26218dd17deb82d503470574a53420f50
+@legacy b329b85ffc088f79c349e96a8fadf106fc96c294ea7e664e31d49caa6d261462 internal/host/units/carlos-instance-rootfs-gen@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs generation's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (RootfsGenDropIn) supplies, so the template alone mounts and runs nothing. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 c58bb18da670653bcf4d94c50a6a0ae3ce826867fc9b15c5316f462db2e5f5fc
+@legacy b7c7d9c115938dfe429d1ea993e31126378a2ffb7040aab48e78e51c120ca7ad internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Task 6: POST /tty runtime=rootfs (startRootfsCmd with RoleTTY) starts it through Plan 2's rootfs one-shot path (preflight, validateStagedImage, ensureRootfsExe under rootfs/tty/, jit drop-in and owed reload, post-start MemoryDenyWriteExecute check); its files go only through removeRootfsUnitFiles (stopRootfs and cleanCmdExe with RoleTTY, the sweep);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 4bea3f4e5d4e3c0dafba7a40fab47c293f82255872678896eee4c12420776f15
+@legacy 31b6ef1a53abdbb55a74a1c48f598ddb4d751d7f1b82bc05c68f386912d62efb internal/host/units/carlos-instance-rootfs-worker@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs worker's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (WorkerDropIn) supplies. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 f945df091a8e399f5592fb6dd84c2ff1a572b76dd1612e52b0cb5f7e5966fc79
+@legacy d3ae72a60359edef5f08f5af89a4fabb91f11d59fbece7c9fde7bcd787d2d63a internal/host/units/carlos-instance-rootfs@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance@.service): new (rootfs Plan 2 Task 4): the run unit of a rootfs instance (ExecStart= the trampoline with --rootfs run, ExecStopPost= instance-exit --rootfs run), Slice=carlos-instances-%i.slice, binding /run/carlos-control/exe/%I/rootfs/run/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 8b3ea34f31bc08283a1104db695526a4d978dfa7016f7705b0cde4d553a40ff6
+@legacy 3009d18729f742c2c981a4c70b913f53fa6665d3b5504f8a4abab10e8b49d982 internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 ec656952a0ad67f93340220dd0cb98afdd8b91a31d717c770ec6df422b6db2f8
+@legacy e068fcaec18439fbc7c4185a4e3a318185cbd5184b8325d6465a2e5d6d5806ca internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 7d46db690a09e3e1a6b8ecf8939afc5ff5af48c9d7032d8b753c7bcad3f00af6
+@legacy c4575c787ea8a0bbd07677f9fef0ee676b4055a944c6be30262dc82f09251396 internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 a3b688a17ec9e304e9327a3231f4975d0ea3262878fb2f40545fed68e53051c7
+@legacy b92e9607055fa8e88ec7017c373e62f48f7298d2d530eeb48822e1b72be80d11 internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 026b90583594efb32c30fe4e55d958be031f2245b9b0a0d38d00f0c5e300d09c
+internal/host/claimunit_template.go const claimBoundTemplate authority E2 PROPOSED E51: Root-only bound-unit template is held inside the claim renderer; ordinary bootstrap never enumerates or installs it.;rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos): at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added data-literal@27 f27e8b84e958fb621ec875ca37ccfbedd5aecb9f13f74c8211475e27420e6700
+internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 b9b64d4f3b5237e7d457dfe8f85d7c3a078ebe7282e903838109f2fa17b6097e
+internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 750392d965ef0f9289d1316d62fe9189c6c4f7e13977e720e8b2810a314be37e
+internal/host/units/carlos-instance-rootfs-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-cmd@.service, accepted at census-ruling-carlos-run): new (rootfs Plan 2 Task 4): the rootfs cmd unit (oneshot, TimeoutStartSec=6h5m, the cmd log sockets), binding /run/carlos-control/exe/%I/rootfs/cmd/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 edf498d72c227f3360c900d25d279cb26218dd17deb82d503470574a53420f50
+internal/host/units/carlos-instance-rootfs-gen@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs generation's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (RootfsGenDropIn) supplies, so the template alone mounts and runs nothing. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 c58bb18da670653bcf4d94c50a6a0ae3ce826867fc9b15c5316f462db2e5f5fc
+internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Task 6: POST /tty runtime=rootfs (startRootfsCmd with RoleTTY) starts it through Plan 2's rootfs one-shot path (preflight, validateStagedImage, ensureRootfsExe under rootfs/tty/, jit drop-in and owed reload, post-start MemoryDenyWriteExecute check); its files go only through removeRootfsUnitFiles (stopRootfs and cleanCmdExe with RoleTTY, the sweep);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 4bea3f4e5d4e3c0dafba7a40fab47c293f82255872678896eee4c12420776f15
+internal/host/units/carlos-instance-rootfs-worker@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs worker's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (WorkerDropIn) supplies. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 f945df091a8e399f5592fb6dd84c2ff1a572b76dd1612e52b0cb5f7e5966fc79
+internal/host/units/carlos-instance-rootfs@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance@.service): new (rootfs Plan 2 Task 4): the run unit of a rootfs instance (ExecStart= the trampoline with --rootfs run, ExecStopPost= instance-exit --rootfs run), Slice=carlos-instances-%i.slice, binding /run/carlos-control/exe/%I/rootfs/run/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the restated rootfs block (byte-identical across the rootfs units);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 8b3ea34f31bc08283a1104db695526a4d978dfa7016f7705b0cde4d553a40ff6
+internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 ec656952a0ad67f93340220dd0cb98afdd8b91a31d717c770ec6df422b6db2f8
+internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 7d46db690a09e3e1a6b8ecf8939afc5ff5af48c9d7032d8b753c7bcad3f00af6
+internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 a3b688a17ec9e304e9327a3231f4975d0ea3262878fb2f40545fed68e53051c7
+internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-528;basis=KillMode=mixed becomes KillMode=control-group plus Environment=CARLOS_INIT_STOP=cgroup (#528; the variable reaches the unit's own trampoline only, run as carlos), with its comment: at stop PID 1 sends the SIGTERM to every process of the unit's own cgroup, not the main process alone, then SIGKILL after TimeoutStopSec as before; no bind source, Exec line, user, mount or path read by root added file:external@0 026b90583594efb32c30fe4e55d958be031f2245b9b0a0d38d00f0c5e300d09c
+@coverage internal/activator 25d3191cc2ac60e488640dbdd27afafb1afe40593ab3ad0649598af9e4aa3514
+@coverage internal/host d6e73a80c1c36019ec40077bba957be829838cd3efaa1a0fee72553d3e891cdb
+@coverage internal/host/units 022cd78b80e53171b9658357b6aa3f5de873a4b489da85207b61344580464b83
+@coverage internal/instancectl 6c733ab44e8601cbae95ac9280e08c6c450e5d1b45b3bacffdbb6967adbd425c
+@coverage internal/instanceexec 7cb751af98d4f2593d02b74f9bdd2025774332a5011f99537ed4e51bb50430fd