From unknown Sun Jul 27 03:20:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist. Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 07 May 2017 04:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26809 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 26809@debbugs.gnu.org X-Debbugs-Original-Cc: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.149413080921497 (code B ref -1); Sun, 07 May 2017 04:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 May 2017 04:20:09 +0000 Received: from localhost ([127.0.0.1]:58946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Dg1-0005af-2d for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Dfz-0005aL-8e for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7Dft-0004JD-4m for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d7Dft-0004J9-1b for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:01 -0400 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 Received: from world.peace.net ([50.252.239.5]:49008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7Dfo-0004IR-Kw; Sun, 07 May 2017 00:19:56 -0400 Received: from pool-72-93-31-169.bstnma.east.verizon.net ([72.93.31.169] helo=jojen) by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d7Dfd-00074R-DX; Sun, 07 May 2017 00:19:45 -0400 From: Mark H Weaver References: <20170502103303.32490.61398@vcs0.savannah.gnu.org> <20170502103307.0229020DD6@vcs0.savannah.gnu.org> Date: Sun, 07 May 2017 00:19:33 -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)") Message-ID: <87wp9tmh7u.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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) From unknown Sun Jul 27 03:20:51 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mark H Weaver Subject: bug#26809: closed (Re: bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist.) Message-ID: References: <871srzmnf5.fsf@gnu.org> <87wp9tmh7u.fsf@netris.org> X-Gnu-PR-Message: they-closed 26809 X-Gnu-PR-Package: guix Reply-To: 26809@debbugs.gnu.org Date: Mon, 08 May 2017 14:31:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1494253863-24018-1" This is a multi-part message in MIME format... ------------=_1494253863-24018-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist. which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 26809@debbugs.gnu.org. --=20 26809: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D26809 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1494253863-24018-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 26809-done) by debbugs.gnu.org; 8 May 2017 14:30:21 +0000 Received: from localhost ([127.0.0.1]:34457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7jg4-0006Di-KJ for submit@debbugs.gnu.org; Mon, 08 May 2017 10:30:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7jg2-0006DW-ID for 26809-done@debbugs.gnu.org; Mon, 08 May 2017 10:30:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7jft-0000CF-CO for 26809-done@debbugs.gnu.org; Mon, 08 May 2017 10:30:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7jft-0000C9-AA; Mon, 08 May 2017 10:30:09 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:57046 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d7jfs-0005Yu-Ku; Mon, 08 May 2017 10:30:09 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mark H Weaver Subject: Re: bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist. References: <20170502103303.32490.61398@vcs0.savannah.gnu.org> <20170502103307.0229020DD6@vcs0.savannah.gnu.org> <87wp9tmh7u.fsf@netris.org> Date: Mon, 08 May 2017 16:30:06 +0200 In-Reply-To: <87wp9tmh7u.fsf@netris.org> (Mark H. Weaver's message of "Sun, 07 May 2017 00:19:33 -0400") Message-ID: <871srzmnf5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26809-done Cc: 26809-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Mark H Weaver skribis: > 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 i= f 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. Indeed. I guess this is fixed by c298fb133acbdc17e05a79c10ab9a9e214368264. Thanks, Ludo=E2=80=99. ------------=_1494253863-24018-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 May 2017 04:20:09 +0000 Received: from localhost ([127.0.0.1]:58946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Dg1-0005af-2d for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Dfz-0005aL-8e for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7Dft-0004JD-4m for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d7Dft-0004J9-1b for submit@debbugs.gnu.org; Sun, 07 May 2017 00:20:01 -0400 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 Received: from world.peace.net ([50.252.239.5]:49008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7Dfo-0004IR-Kw; Sun, 07 May 2017 00:19:56 -0400 Received: from pool-72-93-31-169.bstnma.east.verizon.net ([72.93.31.169] helo=jojen) by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d7Dfd-00074R-DX; Sun, 07 May 2017 00:19:45 -0400 From: Mark H Weaver To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist. References: <20170502103303.32490.61398@vcs0.savannah.gnu.org> <20170502103307.0229020DD6@vcs0.savannah.gnu.org> Date: Sun, 07 May 2017 00:19:33 -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)") Message-ID: <87wp9tmh7u.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: bug-guix@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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) ------------=_1494253863-24018-1--