WEFT_OS/crates/weft-appd
Marco Allegretti 71b7bdf657 feat(appd): wrap runtime in systemd-run cgroup scope when user session is active
supervise() checks /systemd/private to detect an active
user systemd session. When present (and WEFT_DISABLE_CGROUP is unset),
the runtime binary is launched via:

  systemd-run --user --scope --wait --collect --slice=weft-apps.slice     -p CPUQuota=200% -p MemoryMax=512M -- <bin> ...

This places each app in a transient weft-apps.slice scope with default
resource limits from the blueprint. The --wait flag keeps systemd-run
alive so child.wait()/child.kill() remain correct.

When no user session is present the command is built directly as before.
WEFT_DISABLE_CGROUP=1 bypasses the wrapping unconditionally.
2026-03-11 15:25:04 +01:00
..
src feat(appd): wrap runtime in systemd-run cgroup scope when user session is active 2026-03-11 15:25:04 +01:00
Cargo.toml feat(appd): add compositor IPC client; send AppSurfaceCreated/Destroyed on session lifecycle 2026-03-11 14:40:55 +01:00