run0: install via scripts/as-root, chandra-root for GUI apps as root, session refuses root
CI / test (push) Failing after 16s

- scripts/as-root runs a command as root with run0 (systemd PID 1 + run0 present), else sudo,
  doas or pkexec; resolves the program to an absolute path since run0 doesn't inherit PATH.
  The install-session recipes use it and pass install.py by absolute path.
- session/chandra-root (installed to /usr/local/bin): run a graphical app as root inside
  Chandra, passing WAYLAND_DISPLAY (absolute) and the Wayland toolkit variables through
  run0 --setenv (or sudo/doas/pkexec env).
- chandra-session: refuses to run as root (CHANDRA_ALLOW_ROOT=1 overrides), fills in HOME and
  XDG_RUNTIME_DIR when started without a login environment, logs when the logind session has
  no seat (run0 --user / su / ssh), and starts an installed polkit agent once the socket is up
  so run0/pkexec from the launcher can prompt (CHANDRA_POLKIT_AGENT picks one or 'none').
- install.py: checks for root before --remove too; installs chandra-root.
- docs/run0.md: invocations for installing, starting from a TTY, apps as root, polkit agents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkq6Hq7AXG85g5HyJU
This commit is contained in:
Claude committed 2026-11-25 20:13:55 +00:00
1 parent f844ac66ff
commit 9c0a794c2d
7 files changed
+254 -8

No files matched your search

+5 -5
View File
@@ -96,23 +96,23 @@ run-drm-native: build-release modules
# Install the Chandra login session (display-manager entry): the wasm compositor + its host (the MoonBit host). Asks for root once.
install-session: compositor-wasm wasmhost modules
run0 python3 session/install.py
scripts/as-root python3 "{{justfile_directory()}}/session/install.py"
# Dev install: symlink the session into this checkout, so after one root install `just compositor-wasm wasmhost modules` is all a rebuild needs.
install-session-dev: compositor-wasm wasmhost modules
run0 python3 session/install.py --link
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --link
# Install the login session with the Rust host (host-wasm) instead of the MoonBit one.
install-session-rust: compositor-wasm host-wasm modules
run0 python3 session/install.py --rust-host
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --rust-host
# Install the login session with the native compositor instead.
install-session-native: build-release modules
run0 python3 session/install.py --native
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --native
# Remove the login session again.
uninstall-session:
run0 python3 session/install.py --remove
scripts/as-root python3 "{{justfile_directory()}}/session/install.py" --remove
# Start a Wayland client inside the running compositor (default: foot).
client *cmd="foot":