3
4
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +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:
Ludovic Courtès 2021-02-25 10:58:20 +01:00
parent 120051e1b9
commit 412e4f081e
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -97,7 +97,11 @@
#~(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