summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorHugo Buddelmeijer <hugo@buddelmeijer.nl>2025-12-12 18:52:09 +0100
committerMaxim Cournoyer <maxim@guixotic.coop>2025-12-22 10:46:52 +0900
commit4281704a25bb385ba61abbce428026475501771b (patch)
tree1dacc30b8ca96ee0fd28ccb7ca686a19447b7f06 /gnu
parentcb8db48a17d32fb0ed83a309f188e8833054030c (diff)
build: Make /etc/hosts a regular file again.
Commit 7c70a1080a0823fd3dd0f7ee83e5d7654ab6a872 ("gnu/system: Simplify the creation of /etc (was: Turn /etc/localtime into a symlink)") made all of the files under /etc other than sudoers symlinks to their store target. This causes a problem at least for the vpn-slice service, which expects to be able to write to said file. * gnu/build/activation.scm (activate-etc): Special-case /etc/hosts to make it a regular file. Change-Id: Ia42dacd8731edba5e72442ab0399bdc3f7101989 Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop> Modified-by: Maxim Cournoyer <maxim@guixotic.coop> Fixes: #4800
Diffstat (limited to 'gnu')
-rw-r--r--gnu/build/activation.scm19
1 files changed, 12 insertions, 7 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index f8a34b021c..e2d1734367 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -321,13 +321,18 @@ EINVAL, ELOOP, etc."
;; convention to be followed.
(source (canonicalize-path* (string-append etc "/" file))))
(rm-f target)
- (if (string=? (basename target) "sudoers")
- (begin
- ;; /etc/sudoers must be a regular file.
- (copy-file source target)
- ;; XXX: dirty hack to meet sudo's expectations
- (chmod target #o440))
- (symlink source target)))) ;usual case
+ (cond ((string=? (basename target) "sudoers")
+ (begin
+ ;; /etc/sudoers must be a regular file.
+ (copy-file source target)
+ ;; XXX: dirty hack to meet sudo's expectations
+ (chmod target #o440)))
+ ((string=? (basename target) "hosts")
+ ;; /etc/hosts must be a regular file, as some software
+ ;; like vpn-slice expect to be able to write to it.
+ (copy-file source target))
+ (else ;usual case
+ (symlink source target)))))
(scandir etc (negate dot-or-dot-dot?)
;; The default is 'string-locale<?', but we don't have
;; it when run from the initrd's statically-linked