| Age | Commit message (Collapse) | Author |
|
Started as a normal user the daemon happily answered "OK <pid>" to
every START and then forked a launcher that died within milliseconds
(EPERM writing /proc/PID/uid_map), leaving the client with an empty
LIST and, because /var/log was not writable either, no log to explain
it.
Check privileges at startup instead of warning: euid must be 0 and
CapEff must carry CAP_SETUID (the 65536-entry uid map of the
container's user namespace) and CAP_SYS_ADMIN (mounting its file
systems, /proc and /dev); exit 1 with an error naming the missing
piece -- this also catches root under a narrowed
CapabilityBoundingSet=.
Container boot output goes to /var/log/guix-containers: warn when that
directory cannot be created or written (read-only /var, hardened unit)
so the missing log is noticed at start-up rather than while debugging a
failed boot. The hardened systemd example in the README was the cause
of exactly that -- ProtectSystem=strict makes /var read-only -- so it
now sets LogsDirectory=guix-containers, and a new "Privileges required"
section documents the requirement.
test/test.c gains test_privileges() (CapEff parse, root/non-root
verdict); ./test/run.sh still passes.
|
|
Killing a container launcher with kill -9 (or an old daemon doing
so) leaves the container's shepherd (PID 1) alive, still holding
e.g. the sshd port, and invisible to LIST. pid_is_container now
also matches 'bin/shepherd --config ...-shepherd.conf', so KILL can
remove strays and LIST reports them.
|
|
The launcher setsid()s, so the container's shepherd (PID 1) and all
its services live in the launcher's process group. Killing only the
tracked launcher pid left the shepherd running -- holding e.g. the
sshd port and making the next START fail to bind. KILL now SIGKILLs
the process group (-pid); daemon shutdown likewise SIGTERMs groups
and SIGKILLs survivors.
|
|
Containers that hang at boot (e.g. blocked on entropy) ignore
SIGTERM; kill -9 them instead.
|
|
* START is refused while a previously started container is still
alive (ERR already running container <pid>)
* new LIST command reports running containers, including those
started by previous daemon instances (via a /proc scan), so they
can be found and KILLed after a daemon restart
* client: new --list option; README updated
|
|
A C daemon (run as root) that starts Guix system containers on
request over a line-based network protocol, plus an unprivileged
Ruby client.
* START/KILL/LOG/FINGERPRINT protocol; one request per connection
* strict validation of store items before exec (HASH-run-container
name, guile shebang, container markers, immutable store file)
* --fingerprint WORD identifies the daemon instance (random hash
when unset); verified by clients and passed to containers in
GUIX_CONTAINER_FINGERPRINT
* on SIGINT/SIGTERM: SIGTERM all started containers, 10s timeout,
then SIGKILL
* container boot output appended to /var/log/guix-containers/
* unit tests for launcher and fingerprint logic
|