diff options
| author | Hugo Buddelmeijer <hugo@buddelmeijer.nl> | 2025-12-12 18:52:09 +0100 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2025-12-22 10:46:52 +0900 |
| commit | 4281704a25bb385ba61abbce428026475501771b (patch) | |
| tree | 1dacc30b8ca96ee0fd28ccb7ca686a19447b7f06 /gnu/build | |
| parent | cb8db48a17d32fb0ed83a309f188e8833054030c (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/build')
| -rw-r--r-- | gnu/build/activation.scm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index f8a34b021c7..e2d1734367d 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm | |||
| @@ -321,13 +321,18 @@ EINVAL, ELOOP, etc." | |||
| 321 | ;; convention to be followed. | 321 | ;; convention to be followed. |
| 322 | (source (canonicalize-path* (string-append etc "/" file)))) | 322 | (source (canonicalize-path* (string-append etc "/" file)))) |
| 323 | (rm-f target) | 323 | (rm-f target) |
| 324 | (if (string=? (basename target) "sudoers") | 324 | (cond ((string=? (basename target) "sudoers") |
| 325 | (begin | 325 | (begin |
| 326 | ;; /etc/sudoers must be a regular file. | 326 | ;; /etc/sudoers must be a regular file. |
| 327 | (copy-file source target) | 327 | (copy-file source target) |
| 328 | ;; XXX: dirty hack to meet sudo's expectations | 328 | ;; XXX: dirty hack to meet sudo's expectations |
| 329 | (chmod target #o440)) | 329 | (chmod target #o440))) |
| 330 | (symlink source target)))) ;usual case | 330 | ((string=? (basename target) "hosts") |
| 331 | ;; /etc/hosts must be a regular file, as some software | ||
| 332 | ;; like vpn-slice expect to be able to write to it. | ||
| 333 | (copy-file source target)) | ||
| 334 | (else ;usual case | ||
| 335 | (symlink source target))))) | ||
| 331 | (scandir etc (negate dot-or-dot-dot?) | 336 | (scandir etc (negate dot-or-dot-dot?) |
| 332 | ;; The default is 'string-locale<?', but we don't have | 337 | ;; The default is 'string-locale<?', but we don't have |
| 333 | ;; it when run from the initrd's statically-linked | 338 | ;; it when run from the initrd's statically-linked |
