Debian Bug report logs -
#362029
debian-installer: Installer doesn't create /etc/resolv.conf
Reported by: Sander <sgr@rotzorg.org>
Date: Tue, 11 Apr 2006 20:49:23 UTC
Severity: important
Tags: confirmed, patch
Fixed in version netcfg/1.59
Done: Otavio Salvador <otavio@ossystems.com.br>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package debian-installer.
(full text, mbox, link).
Acknowledgement sent to Sander <sgr@rotzorg.org>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: debian-installer
Severity: important
Tags: experimental
I'm trying to install a system from the daily images.
(http://www.debian.org/devel/debian-installer/)
After configuring the nameserver and hostname, the system can't
resolve the hostnames of Debian mirrors. There is no /etc/resolv.conf
created.
Creating /etc/resolv.conf, and retrying the setup succeeds.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13.4
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package debian-installer.
(full text, mbox, link).
Acknowledgement sent to Sander <sgr@rotzorg.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(full text, mbox, link).
Message #10 received at 362029@bugs.debian.org (full text, mbox, reply):
Package: debian-installer
Followup-For: Bug #362029
To clarify the previous report, i didn't supply search and
domain-name-server in the DHCP offer. I did enter values on the
prompt in the installer.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13.4
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Bug reassigned from package `netcfg' to `netcfg'.
Request was from Joey Hess <joeyh@debian.org>
to control@bugs.debian.org.
(full text, mbox, link).
Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(full text, mbox, link).
Acknowledgement sent to 362029@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(full text, mbox, link).
Message #19 received at 362029@bugs.debian.org (full text, mbox, reply):
reassign 362029 netcfg
tags 362029 - experimental
tags 362029 + confirmed
thanks
> After configuring the nameserver and hostname, the system can't
> resolve the hostnames of Debian mirrors. There is no /etc/resolv.conf
> created.
I've confirmed this. If the domain name and/or the name servers are not
provided by the DHCP server, netcfg _will_ ask for them, but fails to
write them to /etc/resolv.conf.
If neither is provided, then /etc/resolv.conf will not even be created.
Bug reassigned from package `netcfg' to `netcfg'.
Request was from Frans Pop <elendil@planet.nl>
to control@bugs.debian.org.
(full text, mbox, link).
Tags removed: experimental
Request was from Frans Pop <elendil@planet.nl>
to control@bugs.debian.org.
(full text, mbox, link).
Tags added: confirmed
Request was from Frans Pop <elendil@planet.nl>
to control@bugs.debian.org.
(full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(Wed, 29 Dec 2010 11:57:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Matthew Palmer <mpalmer@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(Wed, 29 Dec 2010 11:57:06 GMT) (full text, mbox, link).
Message #30 received at 362029@bugs.debian.org (full text, mbox, reply):
I can still reproduce this with the latest mini.iso I can find on
ftp.debian.org (20101127). To be absolutely clear, this is what I'm doing
to show the problem:
1) Setup a DHCP server that provides an address and default route, but does
not provide any DNS servers or domain name.
2) Boot the ISO, answer the usual language/keymap questions
3) After the hardware is detected and the network is configured using DHCP,
the first question that is asked is "Name server addresses:"
(netcfg/get_nameservers), then "Hostname:" (netcfg/get_hostname), and then
"Domain name:" (netcfg/get_domain). Answer each appropriately.
4) When the "Debian archive mirror country:" question appears, Alt+F3, enter
the console, and then cat /etc/resolv.conf, and note that lo! there is
nothing there. On a full-DHCP configuration (or an all-static endeavour)
you get a file with sensible-looking contents instead.
Grovelling through the code suggests that the problem is that if we're using
DHCP, we *absolutely* rely on udhcpc to write resolv.conf for us, which of
course doesn't write anything if it didn't get anything relevant. At no
point in the "ask questions manually" mechanism do we actually *write* any
of the requested data out. What makes it really tricky is that we could get
one of the two items via DHCP and ask the other manually, and we can't just
bulldoze an existing (but incomplete) resolv.conf and rewrite it with
*other* incomplete information...
I'm working on understanding the code properly, and covering all the corner
cases, and should have a patch Real Soon Now.
- Matt
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(Thu, 30 Dec 2010 02:39:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Matthew Palmer <mpalmer@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(Thu, 30 Dec 2010 02:39:03 GMT) (full text, mbox, link).
Message #35 received at 362029@bugs.debian.org (full text, mbox, reply):
tag 362029 +patch
thanks
The attached patch fixes netcfg to write a complete resolv.conf if the DHCP
server doesn't provide all of the necessary data for that file. As
previously mentioned, the problem is that the DHCP configuration method
assumes that resolv.conf will *always* be written entirely by udhcpc. This
patch writes out resolv.conf whenever netcfg asks for some piece of
resolv.conf-relevant information.
The complication is that if resolvers were configured by udhcpc, netcfg
*doesn't* *know* about that information, so if netcfg rewrites resolv.conf
the resolver info is lost. So we need to read that data out of resolv.conf
before we rewrite it -- that's where half the code comes from in this patch.
I've tested the patch with a DHCP server that supplies:
* neither domain-name nor domain-name-servers,
* Just domain-name,
* Just domain-name-servers, and
* Both domain-name and domain-name-servers.
With this patch, all four of those cases result in a resolv.conf that
contains all of the information supplied via DHCP and relevant debconf
questions.
- Matt
Added tag(s) patch.
Request was from Matthew Palmer <mpalmer@debian.org>
to control@bugs.debian.org.
(Thu, 30 Dec 2010 02:39:05 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(Thu, 30 Dec 2010 03:33:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Matthew Palmer <mpalmer@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(Thu, 30 Dec 2010 03:33:03 GMT) (full text, mbox, link).
Message #42 received at 362029@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Le sigh...
- Matt
[write_resolv_conf_on_incomplete_dhcp.patch (text/x-diff, attachment)]
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(Thu, 30 Dec 2010 07:21:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Christian PERRIER <bubulle@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(Thu, 30 Dec 2010 07:21:03 GMT) (full text, mbox, link).
Message #47 received at 362029@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Quoting Matthew Palmer (mpalmer@debian.org):
> Le sigh...
>
> - Matt
:-)
I added this bug the RC1 blockers (http://wiki.debian.org/DebianInstaller/ReleaseAnnounce). Given that you confirmed that you
carefully tested this patch, I'm ready to commit it and rebuild
netcfg...unless other team members have objections to this.
Thnaks for your work investigating this (and doing some cleaning work
in netcfg bugs).
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(Thu, 30 Dec 2010 20:30:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Ferenc Wagner <wferi@niif.hu>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(Thu, 30 Dec 2010 20:30:03 GMT) (full text, mbox, link).
Message #52 received at 362029@bugs.debian.org (full text, mbox, reply):
Matthew Palmer <mpalmer@debian.org> writes:
> Index: netcfg/dhcp.c
> ===================================================================
> --- netcfg/dhcp.c (revision 66154)
> +++ netcfg/dhcp.c (working copy)
> @@ -521,6 +521,7 @@ (after udhcpc exited with a lease)
> }
>
> netcfg_nameservers_to_array (nameservers, nameserver_array);
> + netcfg_write_resolv (domain, nameserver_array);
> }
>
> state = HOSTNAME;
> @@ -602,6 +603,16 @@ (in case DOMAIN:)
> else {
> netcfg_write_common(ipaddress, hostname, domain);
> netcfg_write_dhcp(interface, dhostname);
> + /* If the resolv.conf was written by udhcpc, then nameserver_array
> + * will be empty and we'll need to populate it. If we asked for
> + * the nameservers, then it'll be full, but nobody will care if we
> + * refill it.
> + */
> + if (read_resolv_conf_nameservers(nameserver_array))
> + netcfg_write_resolv(domain, nameserver_array);
> + else
> + printf("Error reading resolv.conf for nameservers\n");
> +
> return 0;
> }
> break;
Hi,
This seems to do the job, but the control flow in netcfg is already
convoluted enough, isn't there a better alternative? I mean, for a
static configuration, netcfg_write_resolv is called from
netcfg_write_static, can't we follow suit in netcfg_write_dhcp? If
netcfg always removed resolv.conf before calling the DHCP client, then
we could modify resolv_conf_entries to also populate nameserver_array,
and then unconditionally write out resolv.conf in netcfg_write_dhcp,
couldn't we? Just thinking out loud....
> @@ -646,3 +657,41 @@
>
> return count;
> }
> +
> +/* Read the nameserver entries out of resolv.conf and stick them into
> + * nameservers_array, so we can write out a newer, shinier resolv.conf
> + */
> +int read_resolv_conf_nameservers(struct in_addr array[])
> +{
> + FILE *f;
> + int i = 0;
> +
> + if ((f = fopen(RESOLV_FILE, "r")) != NULL) {
> + char buf[256];
> +
> + while (fgets(buf, 256, f) != NULL) {
> + char *ptr;
> +
> + if (strncmp(buf, "nameserver ", strlen("nameserver ")) == 0) {
> + /* Chop off trailing \n */
> + while (buf[strlen(buf)-1] == '\n')
> + buf[strlen(buf)-1] = '\0';
Why is this "while" instead of "if"?
> + ptr = buf + strlen("nameserver ");
> + inet_pton(AF_INET, ptr, &array[i++]);
> + if (i == 3) {
We really should use a global constant here (and in netcfg.h and in
netcfg_nameservers_to_array at least) instead of the magic number 3...
> + /* We can only hold so many nameservers, and we've reached
> + * our limit. Sorry.
> + */
--
Regards,
Feri.
Added tag(s) pending.
Request was from Miguel Figueiredo <elmig@debianpt.org>
to control@bugs.debian.org.
(Sat, 01 Jan 2011 12:03:06 GMT) (full text, mbox, link).
Reply sent
to Otavio Salvador <otavio@ossystems.com.br>:
You have taken responsibility.
(Sun, 02 Jan 2011 16:48:12 GMT) (full text, mbox, link).
Notification sent
to Sander <sgr@rotzorg.org>:
Bug acknowledged by developer.
(Sun, 02 Jan 2011 16:48:12 GMT) (full text, mbox, link).
Message #59 received at 362029-close@bugs.debian.org (full text, mbox, reply):
Source: netcfg
Source-Version: 1.59
We believe that the bug you reported is fixed in the latest version of
netcfg, which is due to be installed in the Debian FTP archive:
netcfg-static_1.59_amd64.udeb
to main/n/netcfg/netcfg-static_1.59_amd64.udeb
netcfg_1.59.dsc
to main/n/netcfg/netcfg_1.59.dsc
netcfg_1.59.tar.gz
to main/n/netcfg/netcfg_1.59.tar.gz
netcfg_1.59_amd64.udeb
to main/n/netcfg/netcfg_1.59_amd64.udeb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 362029@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Otavio Salvador <otavio@ossystems.com.br> (supplier of updated netcfg package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Sun, 02 Jan 2011 14:29:22 -0200
Source: netcfg
Binary: netcfg netcfg-static
Architecture: source amd64
Version: 1.59
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Otavio Salvador <otavio@ossystems.com.br>
Description:
netcfg - Configure the network (udeb)
netcfg-static - Configure a static network (udeb)
Closes: 362029 608452
Changes:
netcfg (1.59) unstable; urgency=low
.
[ Matt Palmer ]
* Modify the DHCP configuration process to write out elements of
resolv.conf that the user has entered manually, because the DHCP server
didn't supply them. Closes: #362029.
* Add an ethtool-lite Makefile target, to assist people in building a
standalone ethtool-lite for debugging purposes. Closes: #608452.
.
[ Updated translations ]
* Northern Sami (se.po) by Børre Gaup
Checksums-Sha1:
d0cd508663808a0dcf4df73eb8146c65e4e28396 1677 netcfg_1.59.dsc
d7c6afbc5e801b0e6c0838d1416997d7dc46b359 424236 netcfg_1.59.tar.gz
3a3a090b23838f1ebe4a36fb75390d117d99bf00 327776 netcfg_1.59_amd64.udeb
8e61afc65104010f2a2507bb7cf655f0ffe277e7 253142 netcfg-static_1.59_amd64.udeb
Checksums-Sha256:
c5d5fb6d922544fdb4f1745d471249f49e8c40431cb2d355419b7e060d8337cf 1677 netcfg_1.59.dsc
f658d89cf903a9d7b5a12ba2ec2d875ba50de92a583b478d21af706513e9d7d4 424236 netcfg_1.59.tar.gz
4a01b503d02a6871997fdf3a47d4f8d123c4462f089af4e3f6d8603fc2d47e95 327776 netcfg_1.59_amd64.udeb
8717048589de4d15a1ce667080fe5cf17ba15196a272e5cf1d57e2b851b78b6b 253142 netcfg-static_1.59_amd64.udeb
Files:
6d06470b89f7be60b1a6e98a40a4fa9c 1677 debian-installer optional netcfg_1.59.dsc
1ccd17702a0f94ef2a1b4de48771bce0 424236 debian-installer optional netcfg_1.59.tar.gz
0f57f85065bb4fa18ea155af3f360d83 327776 debian-installer optional netcfg_1.59_amd64.udeb
b335345917e3859283de1d6bbf18aba7 253142 debian-installer optional netcfg-static_1.59_amd64.udeb
Package-Type: udeb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQIcBAEBCAAGBQJNIKgMAAoJEOtw/vPN/G5Pr/cQAKCSfS254sMP+4XiaItZCNUq
J/5zspqzc3JrtF3/n67H+SpGNJzJu9Xe7uI7SbLJituT4D5HmAqQmwKg1RXmX6gn
CXLtqfDvwNZOPo4Zv6NH0u9sxzYremZaQK3kLqf9HMOGlvmsLwXhpTGb1pl039zG
1Sbhchf/S0P1Tt5HuaNJOFvptIeeM4gXPMuVwvGE1pHMQ4IMEZ9n7pWSUPno4oi6
gpg0iur2EW11EFtoOFq/rLKQQO06sgcscfnnBCx1Sd4zbI1fyl+6XawDYfDea6bf
hcfIYFjQbzkXbbxUdRxD4Xx62RPCtBDeq6xrxSeZdT2yU9P6Vj/T/P8EZvWk4OX8
5XoT4gdEtwPe2aIt1kZYYBzPE4g6HqcKmMxBGyspRBur8sjsv1qbg6WzBeCVXGYb
W4p7M0qv1C/wGPDUSOWUGT8fYGgJZ39jpwFjoKKz7zs6mqRs+SsIJ9euaKHwWWAG
NPVgWAEqGv9vIhqFV4Aoo1J3wgSUID5m0Chy7bq60M9PeX+TV1GPhb86+jQ7bLf5
yJTOHt5UDGoKWmU5mvwmb4ncg6LdLXnsfdcU/iBIg7VA4KV3ETV0ZOFk+8/740Ac
kUs+TbJCJFi/zr4xnMTgHFphby11ZZtRyjTXYcGd39ZVLl/Hj63Z/0jb3CynxKHM
bSxOqa401tbNko9tw6Nf
=SZWh
-----END PGP SIGNATURE-----
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(Sun, 02 Jan 2011 23:21:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Sander De Graaf <sander@rotzorg.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(Sun, 02 Jan 2011 23:21:03 GMT) (full text, mbox, link).
Message #64 received at 362029@bugs.debian.org (full text, mbox, reply):
It's a long time since i filed this bug report, and I'm pleasantly surprised that it's believed fixed. Thanks for the work :)
Sander
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#362029; Package netcfg.
(Mon, 03 Jan 2011 01:57:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Matthew Palmer <mpalmer@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(Mon, 03 Jan 2011 01:57:03 GMT) (full text, mbox, link).
Message #69 received at 362029@bugs.debian.org (full text, mbox, reply):
On Sun, Jan 02, 2011 at 11:58:11PM +0100, Sander De Graaf wrote:
> It's a long time since i filed this bug report, and I'm pleasantly
> surprised that it's believed fixed. Thanks for the work :)
You know what they say... better late than never. <grin>
- Matt
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Wed, 02 Feb 2011 07:33:57 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Thu Jan 11 08:21:14 2018;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.