mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
services: nscd: Adjust activation snippet for /etc/resolv.conf symlinks.
Fixes <http://bugs.gnu.org/26809>. Reported by Mark H Weaver <mhw@netris.org>. * gnu/services/base.scm (nscd-activation): Use 'lstat' instead of 'file-exists?'.
This commit is contained in:
parent
ddce2d3aae
commit
c298fb133a
1 changed files with 4 additions and 2 deletions
|
@ -1152,8 +1152,10 @@ (define nscd-activation
|
|||
(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")
|
||||
;; that file exists when it is started. Thus create it here. Note: on
|
||||
;; some systems, such as when NetworkManager is used, /etc/resolv.conf
|
||||
;; is a symlink, hence 'lstat'.
|
||||
(unless (false-if-exception (lstat "/etc/resolv.conf"))
|
||||
(call-with-output-file "/etc/resolv.conf"
|
||||
(lambda (port)
|
||||
(display "# This is a placeholder.\n" port))))))
|
||||
|
|
Loading…
Reference in a new issue