[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/07: services: shepherd: Make /run/booted-system a symlink to the stor
From: |
guix-commits |
Subject: |
02/07: services: shepherd: Make /run/booted-system a symlink to the store item. |
Date: |
Thu, 25 Feb 2021 05:42:25 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 412e4f081e9cdf38db9859e1548ef2362cde678e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Feb 25 10:58:20 2021 +0100
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'.
---
gnu/services/shepherd.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index e2ec59f..19a052c 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -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
- branch master updated (7330306 -> dcb640f), guix-commits, 2021/02/25
- 01/07: machine: ssh: Use 'formatted-message'., guix-commits, 2021/02/25
- 02/07: services: shepherd: Make /run/booted-system a symlink to the store item.,
guix-commits <=
- 03/07: system: vm: Use Guile 3.0 in Docker images., guix-commits, 2021/02/25
- 04/07: tests: docker-system: Increase VM memory., guix-commits, 2021/02/25
- 07/07: file-systems: 'mount-file-system' preserves source flags for bind mounts., guix-commits, 2021/02/25
- 05/07: syscalls: Define MS_RELATIME., guix-commits, 2021/02/25
- 06/07: syscalls: Add 'mounts' and the <mount> record type., guix-commits, 2021/02/25