* bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist.
[not found] ` <20170502103307.0229020DD6@vcs0.savannah.gnu.org>
@ 2017-05-07 4:19 ` Mark H Weaver
2017-05-08 14:30 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Mark H Weaver @ 2017-05-07 4:19 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 26809
ludo@gnu.org (Ludovic Courtès) writes:
> civodul pushed a commit to branch master
> in repository guix.
>
> commit 49f9d7f697d19870f01104cdb6a90a32aea87679
> Author: Ludovic Courtès <ludo@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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist.
2017-05-07 4:19 ` bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist Mark H Weaver
@ 2017-05-08 14:30 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2017-05-08 14:30 UTC (permalink / raw)
To: Mark H Weaver; +Cc: 26809-done
Mark H Weaver <mhw@netris.org> skribis:
> ludo@gnu.org (Ludovic Courtès) writes:
>
>> civodul pushed a commit to branch master
>> in repository guix.
>>
>> commit 49f9d7f697d19870f01104cdb6a90a32aea87679
>> Author: Ludovic Courtès <ludo@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’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-08 14:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170502103303.32490.61398@vcs0.savannah.gnu.org>
[not found] ` <20170502103307.0229020DD6@vcs0.savannah.gnu.org>
2017-05-07 4:19 ` bug#26809: 08/09: services: nscd: Create /etc/resolv.conf if it does not exist Mark H Weaver
2017-05-08 14:30 ` Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.