mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-14 19:10:49 +02:00
services: guix: ‘guix-ownership’ changes store ownership last.
Fixes <https://issues.guix.gnu.org/78355>. * gnu/services/base.scm (guix-ownership-change-program)[claim-data-ownership]: Replace hard-coded “/gnu/store” with #$(store-prefix). Change store ownership last. Reported-by: Rutherther <rutherther@ditigal.xyz> Change-Id: I55189f8bb82bf0c9e030aa042aa928f6f552569e
This commit is contained in:
parent
04e80066a2
commit
c33bc80080
1 changed files with 7 additions and 4 deletions
|
@ -1997,10 +1997,9 @@ of Guix to the given UID and GID."
|
||||||
lstat))
|
lstat))
|
||||||
|
|
||||||
(define (claim-data-ownership uid gid)
|
(define (claim-data-ownership uid gid)
|
||||||
(format #t "Changing file ownership for /gnu/store \
|
(format #t "Changing file ownership for ~a \
|
||||||
and data directories to ~a:~a...~%"
|
and data directories to ~a:~a...~%"
|
||||||
uid gid)
|
#$(%store-prefix) uid gid)
|
||||||
(change-ownership #$(%store-prefix) uid gid)
|
|
||||||
(let ((excluded '("." ".." "profiles" "userpool")))
|
(let ((excluded '("." ".." "profiles" "userpool")))
|
||||||
(for-each (lambda (directory)
|
(for-each (lambda (directory)
|
||||||
(change-ownership (in-vicinity "/var/guix" directory)
|
(change-ownership (in-vicinity "/var/guix" directory)
|
||||||
|
@ -2012,7 +2011,11 @@ and data directories to ~a:~a...~%"
|
||||||
(chown "/var/guix" uid gid)
|
(chown "/var/guix" uid gid)
|
||||||
(change-ownership "/etc/guix" uid gid)
|
(change-ownership "/etc/guix" uid gid)
|
||||||
(mkdir-p "/var/log/guix")
|
(mkdir-p "/var/log/guix")
|
||||||
(change-ownership "/var/log/guix" uid gid))
|
(change-ownership "/var/log/guix" uid gid)
|
||||||
|
|
||||||
|
;; Change the store last so that, if this service is interrupted,
|
||||||
|
;; ownership appears as having yet to be changed.
|
||||||
|
(change-ownership #$(%store-prefix) uid gid))
|
||||||
|
|
||||||
(match (command-line)
|
(match (command-line)
|
||||||
((_ (= string->number (? integer? uid))
|
((_ (= string->number (? integer? uid))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue