strips domain part from netcfg/get_hostname

Bug #23714 reported by Timo Aaltonen
6
Affects Status Importance Assigned to Milestone
netcfg
Invalid
Undecided
Unassigned
netcfg (Debian)
Fix Released
Unknown
netcfg (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

D-I strips the domain part out of netcfg/get_hostname, and that is something I
just can't undestand why... If I preseed the hostname, I want to decide what it
is and the installer should just comply!

Revision history for this message
Colin Watson (cjwatson) wrote :

That shouldn't be happening without the domain part being stuffed into
netcfg/get_domain. Please give more information about what you're doing, the
type of network configuration you're doing (DHCP or static), and what you're seeing.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

this is what I dump in /preseed.cfg (the variables are parsed from
/proc/cmdline), this is from /lib/debian-installer-startup.d/S25hutcc-preseed:

  cat <<EOF>>/preseed.cfg
d-i netcfg/disable_dhcp boolean true
d-i netcfg/get_nameservers string 130.233.224.1 130.233.224.13
d-i netcfg/choose_interface string ${IFDEV}
d-i netcfg/get_hostname string ${HOSTNAME}.hut.fi
d-i netcfg/get_domain string hut.fi
d-i netcfg/get_ipaddress string ${IPADDR}
d-i netcfg/get_netmask string ${NETMASK}
d-i netcfg/get_gateway string ${GATEWAY}
d-i netcfg/confirm_static boolean true
EOF

and if I cat /etc/hostname in the shell, it shows the shortname. I tried
commenting out get_domain, but it didn't have any effect. The preseed.cfg looks
fine.

Revision history for this message
Colin Watson (cjwatson) wrote :

I don't see a problem with it only putting the hostname part in /etc/hostname,
as long as the FQDN is put in /etc/hosts where the resolver can find it when
applications ask for the qualified hostname. What's in /etc/hosts and
/etc/resolv.conf? The domain should have been written there.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

hosts: ok (xxx.xxx.xxx.xxx host.hut.fi host)
resolv.conf: ok ("search hut.fi")

it's just that a number of stuff here depend on /etc/hostname, and the output of
"hostname"... so I'm not looking forward in making those work with d-i...

I don't see the benefit of changing get_hostname.

Revision history for this message
In , Joey Hess (joeyh) wrote : hostname/domain name preseeding is quite broken

Package: netcfg
Severity: normal

The support for preseeding the hostname and domain name is very broken in
netcfg. The debconf questions netcfg/get_hostname and netcfg/get_domain are
badly named (should be netcfg/hostname and netcfg/domain). netcfg sets
these to values that it finds in dns or dhcp with no regard to any
existing preseeded value, so you can't override the dns or dhcp with
preseeding, which should be possible for installing on a broken network.

The installation manual puts the best face it can on netcfg's behavior
with this:

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

I think that netcfg's use of these variables needs to be rewritten, to
make it

a) take care to not trample over existing settings
b) if there is no existing value, use dhcp/dns to get a good default
c) if the user enters something wrong or goes back, unset the value to
   avoid a) above preventing b) from working when the question is asked
   again

Since it would change the behavior of the two questions to do this, and
require preseeding changes, this would be a good chance to rename them
too.

--
see shy jo

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343269

All the other unices (that we have, at least: Tru64, AIX, Solaris, OSX) output
fqdn with "hostname". And if you are an "enterprise" where a single machine is
registered to a number of places, you have to rely on a sane hostname (=fqdn).
So, I'm happy to see that this is being noticed upstream, too.

Changed in netcfg:
status: Unknown → Unconfirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

Rejecting bogus upstream task; netcfg is a Debian package, so a distribution task is more appropriate.

Changed in netcfg:
status: Unconfirmed → Rejected
Changed in netcfg:
status: Unknown → Unconfirmed
Colin Watson (cjwatson)
Changed in netcfg:
assignee: kamion → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for netcfg (Ubuntu) because there has been no activity for 60 days.]

Changed in netcfg (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.