GNU bug report logs - #26809
08/09: services: nscd: Create /etc/resolv.conf if it does not exist.

Previous Next

Package: guix;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Sun, 7 May 2017 04:21:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26809 in the body.
You can then email your comments to 26809 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#26809; Package guix. (Sun, 07 May 2017 04:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark H Weaver <mhw <at> netris.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 07 May 2017 04:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: bug-guix <at> gnu.org
Subject: Re: 08/09: services: nscd: Create /etc/resolv.conf if it does not
 exist.
Date: Sun, 07 May 2017 00:19:33 -0400
ludo <at> gnu.org (Ludovic Courtès) writes:

> civodul pushed a commit to branch master
> in repository guix.
>
> commit 49f9d7f697d19870f01104cdb6a90a32aea87679
> Author: Ludovic Courtès <ludo <at> gnu.org>
> Date:   Tue May 2 12:21:31 2017 +0200
>
>     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.

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 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)




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Mon, 08 May 2017 14:31:02 GMT) Full text and rfc822 format available.

Notification sent to Mark H Weaver <mhw <at> netris.org>:
bug acknowledged by developer. (Mon, 08 May 2017 14:31:03 GMT) Full text and rfc822 format available.

Message #10 received at 26809-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw <at> netris.org>
Cc: 26809-done <at> debbugs.gnu.org
Subject: Re: bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it
 does not exist.
Date: Mon, 08 May 2017 16:30:06 +0200
Mark H Weaver <mhw <at> netris.org> skribis:

> ludo <at> gnu.org (Ludovic Courtès) writes:
>
>> civodul pushed a commit to branch master
>> in repository guix.
>>
>> commit 49f9d7f697d19870f01104cdb6a90a32aea87679
>> Author: Ludovic Courtès <ludo <at> gnu.org>
>> Date:   Tue May 2 12:21:31 2017 +0200
>>
>>     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.
>
> 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’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Jun 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 343 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.