about summary refs log tree commit diff
path: root/README.md
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-12 15:59:15 +0000
committerPjotr <wrk@bosa.lan>2026-11-12 15:59:15 +0000
commitea559e1a7d9bee12c89feddc58a98f36832d59ed (patch)
tree69b185b076861c90f846e6f11cf5c2f0f8003f29 /README.md
parentdf684f4481dc4bc9c6331b11ede16b3d7d7a2ed8 (diff)
downloadrun-guix-container-master.tar.gz
daemon: make the log directory configurable (--log-dir / GUIX_CONTAINER_LOG_DIR) HEAD master
/var/log/guix-containers was a #define, and the daemon read no environment
variables at all, so a host whose /var/log is read-only -- or anyone running
the daemon outside a system-wide install -- had no way to keep container boot
output except to edit and rebuild the C. It is now a runtime value: the flag
wins, then $GUIX_CONTAINER_LOG_DIR, then the old default, and all three uses
(the mkdir, the .writable probe, the per-container <name>.log path) go through
it.

The chosen directory is named at startup ("container logs: DIR") before the
privilege check, for two reasons: it is the first thing an operator needs when
a container does not come up, and it makes the switch observable without root,
which is how test/run.sh now checks it -- --log-dir and the env var each have
to appear in that line, and an unknown option still has to print the usage.

README: documents the flag and the variable, says which wins, and points
ProtectSystem=strict users at --log-dir as the alternative to LogsDirectory=.
Also generalises one line that said "uid=1000(wrk)" -- true of the author's
box, misleading on anyone else's -- to "your own uid, e.g. uid=1000".
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 11 insertions, 6 deletions
diff --git a/README.md b/README.md
index 562b0ed..5d322b5 100644
--- a/README.md
+++ b/README.md
@@ -153,11 +153,15 @@ error: run-guix-system-container must run as root (uid 1000): container
   START fails
 ```
 
-Container boot output goes to `/var/log/guix-containers`.  If that
-directory cannot be created or written (read-only `/var`, hardened
-unit) the daemon only warns -- containers still run -- but a boot
-failure then leaves no log to read.  With `ProtectSystem=strict` set
-`LogsDirectory=guix-containers` (or `ReadWritePaths=/var/log/guix-containers`).
+Container boot output goes to `/var/log/guix-containers`, or wherever
+`--log-dir DIR` (or `$GUIX_CONTAINER_LOG_DIR`) points -- the flag wins over
+the variable, and the default above applies when neither is given.  If that
+directory cannot be created or written (read-only `/var`, hardened unit, a
+daemon that is not system-wide) the daemon only warns -- containers still
+run -- but a boot failure then leaves no log to read.  With
+`ProtectSystem=strict` either point `--log-dir` at a writable path or set
+`LogsDirectory=guix-containers` (equivalently
+`ReadWritePaths=/var/log/guix-containers`).
 
 ## Running it
 
@@ -434,7 +438,8 @@ guix package -p /tmp/rootless-test/profile -i coreutils   # built via the host d
 guix shell -C -p /tmp/rootless-test/profile -- /bin/sh -c 'id'
 ```
 
-Inside such a container you are still yourself (`uid=1000(wrk)`), there
+Inside such a container you are still yourself (your own uid, e.g.
+`uid=1000`), there
 is no shepherd, no sshd and no `guix system` services — but a stack of
 foreground daemons (nginx + php-fpm + octave, ports > 1024, data via
 `--share=...`) runs fine for fast zero-privilege smoke tests.