summary refs log tree commit diff
path: root/gnu/build/shepherd.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-09-26 17:07:55 +0200
committerLudovic Courtès <ludo@gnu.org>2019-09-26 23:15:28 +0200
commit464caf72f9ff7600bd49e2df07e19cd9af28a930 (patch)
tree2a3907b8b8da4c4ff136b1a2cf6e82b34aeb1b5e /gnu/build/shepherd.scm
parent0d3a4fc867100651af8b27cdf66b1bca1c8ba663 (diff)
downloadguix-464caf72f9ff7600bd49e2df07e19cd9af28a930.tar.gz
shepherd: Ensure the log file has correct ownership.
* gnu/build/shepherd.scm (make-forkexec-constructor/container): Ensure
LOG-FILE has correct ownership.
Diffstat (limited to 'gnu/build/shepherd.scm')
-rw-r--r--gnu/build/shepherd.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm
index 461feb06ef..14bdf4edb8 100644
--- a/gnu/build/shepherd.scm
+++ b/gnu/build/shepherd.scm
@@ -150,7 +150,10 @@ namespace, in addition to essential bind-mounts such /proc."
     (when log-file
       ;; Create LOG-FILE so we can map it in the container.
       (unless (file-exists? log-file)
-        (call-with-output-file log-file (const #t))))
+        (call-with-output-file log-file (const #t))
+        (when user
+          (let ((pw (getpwnam user)))
+            (chown log-file (passwd:uid pw) (passwd:gid pw))))))
 
     (let ((pid (run-container container-directory
                               mounts namespaces 1