mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 05:57:04 +01:00
services: shepherd: Make /run/booted-system a symlink to the store item.
Fixes <https://bugs.gnu.org/46767>. Previously /run/booted-system would end up referring to /var/guix/profiles/system-NNN-link; consequently, the booted system would not be GC-protected. * gnu/services/shepherd.scm (shepherd-boot-gexp): Call 'canonicalize-path' instead of 'readlink'.
This commit is contained in:
parent
120051e1b9
commit
412e4f081e
1 changed files with 5 additions and 1 deletions
|
@ -97,7 +97,11 @@ (define (shepherd-boot-gexp config)
|
|||
#~(begin
|
||||
;; Keep track of the booted system.
|
||||
(false-if-exception (delete-file "/run/booted-system"))
|
||||
(symlink (readlink "/run/current-system")
|
||||
|
||||
;; Make /run/booted-system, an indirect GC root, point to the store item
|
||||
;; /run/current-system points to. Use 'canonicalize-path' rather than
|
||||
;; 'readlink' to make sure we get the store item.
|
||||
(symlink (canonicalize-path "/run/current-system")
|
||||
"/run/booted-system")
|
||||
|
||||
;; Close any remaining open file descriptors to be on the safe
|
||||
|
|
Loading…
Reference in a new issue