mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
shepherd: Ensure the log file has correct ownership.
* gnu/build/shepherd.scm (make-forkexec-constructor/container): Ensure LOG-FILE has correct ownership.
This commit is contained in:
parent
0d3a4fc867
commit
464caf72f9
1 changed files with 4 additions and 1 deletions
|
@ -150,7 +150,10 @@ (define mounts
|
||||||
(when log-file
|
(when log-file
|
||||||
;; Create LOG-FILE so we can map it in the container.
|
;; Create LOG-FILE so we can map it in the container.
|
||||||
(unless (file-exists? log-file)
|
(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
|
(let ((pid (run-container container-directory
|
||||||
mounts namespaces 1
|
mounts namespaces 1
|
||||||
|
|
Loading…
Reference in a new issue