From 49f9d7f697d19870f01104cdb6a90a32aea87679 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 2 May 2017 12:21:31 +0200 Subject: services: nscd: Create /etc/resolv.conf if it does not exist. * gnu/services/base.scm (nscd-activation): Create /etc/resolv.conf if it does not exist yet. --- gnu/services/base.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 67972bf614..a64faa0d18 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1149,7 +1149,14 @@ (define nscd-activation #~(begin (use-modules (guix build utils)) (mkdir-p "/var/run/nscd") - (mkdir-p "/var/db/nscd"))) ;for the persistent cache + (mkdir-p "/var/db/nscd") ;for the persistent cache + + ;; In libc 2.25 nscd uses inotify to watch /etc/resolv.conf, but only if + ;; that file exists when it is started. Thus create it here. + (unless (file-exists? "/etc/resolv.conf") + (call-with-output-file "/etc/resolv.conf" + (lambda (port) + (display "# This is a placeholder.\n" port)))))) (define nscd-service-type (service-type (name 'nscd) -- cgit v1.2.3