summary refs log tree commit diff
path: root/gnu/build/shepherd.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/build/shepherd.scm')
-rw-r--r--gnu/build/shepherd.scm14
1 files changed, 5 insertions, 9 deletions
diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm
index cf68f2108b..14bdf4edb8 100644
--- a/gnu/build/shepherd.scm
+++ b/gnu/build/shepherd.scm
@@ -67,16 +67,10 @@
           (file-system-mapping
            (source "/etc/group") (target source))))
 
-  (define nscd-socket
-    (file-system-mapping
-     (source "/var/run/nscd") (target source)
-     (writable? #t)))
-
   (append (cons (tmpfs "/tmp") %container-file-systems)
           (let ((mappings `(,@(if (memq 'net namespaces)
                                   '()
-                                  (cons nscd-socket
-                                        %network-file-mappings))
+                                  %network-file-mappings)
                             ,@(if (and (memq 'mnt namespaces)
                                        (not (memq 'user namespaces)))
                                   accounts
@@ -156,14 +150,16 @@ 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
                               (lambda ()
                                 (mkdir-p "/var/run")
                                 (clean-up pid-file)
-                                (clean-up log-file)
 
                                 (exec-command command
                                               #:user user