From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist. Date: Sun, 07 May 2017 00:19:33 -0400 Message-ID: <87wp9tmh7u.fsf@netris.org> References: <20170502103303.32490.61398@vcs0.savannah.gnu.org> <20170502103307.0229020DD6@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7Dgw-0005n5-72 for bug-guix@gnu.org; Sun, 07 May 2017 00:21:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7Dgt-0004RU-0f for bug-guix@gnu.org; Sun, 07 May 2017 00:21:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60747) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7Dgs-0004RQ-Th for bug-guix@gnu.org; Sun, 07 May 2017 00:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d7Dgs-0005cA-M0 for bug-guix@gnu.org; Sun, 07 May 2017 00:21:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7Dfr-0005Hp-Vs for bug-guix@gnu.org; Sun, 07 May 2017 00:20:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7Dfo-0004Io-PG for bug-guix@gnu.org; Sun, 07 May 2017 00:19:59 -0400 In-Reply-To: <20170502103307.0229020DD6@vcs0.savannah.gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22's\?\= message of "Tue, 2 May 2017 06:33:05 -0400 (EDT)") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 26809@debbugs.gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > civodul pushed a commit to branch master > in repository guix. > > commit 49f9d7f697d19870f01104cdb6a90a32aea87679 > Author: Ludovic Court=C3=A8s > Date: Tue May 2 12:21:31 2017 +0200 > > services: nscd: Create /etc/resolv.conf if it does not exist. >=20=20=20=20=20 > * gnu/services/base.scm (nscd-activation): Create /etc/resolv.conf if= it > does not exist yet. This commit broke the boot process on my system. The problem is that I'm using Network Manager, which makes /etc/resolv.conf into a symlink that points to /var/run/NetworkManager/resolv.conf. Since /var/run is cleaned during early boot, when this new activation code runs, /etc/resolv.conf is a broken symlink. I guess that 'file-exists?' returns #false for a broken symlink, and the 'call-with-output-file' tries to open the target of the symlink, which fails. Mark > diff --git a/gnu/services/base.scm b/gnu/services/base.scm > index 67972bf..a64faa0 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 ca= che > + (mkdir-p "/var/db/nscd") ;for the persistent ca= che > + > + ;; In libc 2.25 nscd uses inotify to watch /etc/resolv.conf, but o= nly 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)))))) >=20=20 > (define nscd-service-type > (service-type (name 'nscd)