summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-05-02 12:21:31 +0200
committerLudovic Courtès <ludo@gnu.org>2017-05-02 12:32:52 +0200
commit49f9d7f697d19870f01104cdb6a90a32aea87679 (patch)
treeff00323634a1e5810503b2ebcb811d7618652f58 /gnu/services
parent1fd0fc0db425b14162a40a04356f113b66c4e5db (diff)
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.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/base.scm9
1 files changed, 8 insertions, 1 deletions
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 @@ the tty to run, among other things."
#~(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)