From 0d3a4fc867100651af8b27cdf66b1bca1c8ba663 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Sep 2019 17:06:33 +0200 Subject: shepherd: 'make-forkexec-constructor/container' keeps the log file. * gnu/build/shepherd.scm (make-forkexec-constructor/container): Don't call 'clean-up' on LOG-FILE. This mirrors Shepherd commit 6892f638c78a14fedd075f664432757bc015c140. --- gnu/build/shepherd.scm | 1 - 1 file changed, 1 deletion(-) (limited to 'gnu/build/shepherd.scm') diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm index b32765ed5e..461feb06ef 100644 --- a/gnu/build/shepherd.scm +++ b/gnu/build/shepherd.scm @@ -157,7 +157,6 @@ namespace, in addition to essential bind-mounts such /proc." (lambda () (mkdir-p "/var/run") (clean-up pid-file) - (clean-up log-file) (exec-command command #:user user -- cgit v1.2.3 From 464caf72f9ff7600bd49e2df07e19cd9af28a930 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Sep 2019 17:07:55 +0200 Subject: shepherd: Ensure the log file has correct ownership. * gnu/build/shepherd.scm (make-forkexec-constructor/container): Ensure LOG-FILE has correct ownership. --- gnu/build/shepherd.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/build/shepherd.scm') 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 -- cgit v1.2.3