Discussion:
CVS import: src/external/bsd/dhcpcd/dist
(too old to reply)
Roy Marples
2013-07-23 08:06:20 UTC
Permalink
* dhcpcd will now assign a short hostname by default
To use a FQDN hostname, set this in dhcpcd.conf(5)
env hostname_fqdn=YES
This is the wrong default, too - hostname should always be FQDN.
This is far from universally agreed upon.
However, ISTM that if dhcpcd is going to set the hostname at all
(which is usually wrong) it should set the hostname the dhcp server
provides and not try to munge it.
Which hostname should dhcpcd set?
You can read the rest of my snipped comment directly above here
http://mail-index.netbsd.org/source-changes-d/2013/07/20/msg005999.html

TLDR: I justify the use of a short hostname with what I think are sound
technical reasons.
imo, dhcpcd should not set a hostname at all, at least not by default.
Maybe it should only set it if no other hostname has been set?
Maybe you should at least read the first paragraph of dhcpcd(8) before
commenting?

Roy

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Erik Bertelsen
2013-07-23 09:06:10 UTC
Permalink
This update changes existing behavior, which may have unexpected
consequences when people upgrade. I observed pkg_chk failing to read a
pkgchk_… file because the hostname was changed after a reboot :-(

Anyway I see two issues here:

1. If hostname is set in /etc/rc.conf, I strongly think that this
should be set as the machine's hostname (FQDN or short or anything
else). In this case dhcpcd should not try to (re)set it. That keeps
the system manager in control.
2. If hostname is not set in /etc/rc.conf I see no problem in dhcpcd
trying to define and set a hostname, e.g. by using a value provided by
the dhcp server. For multi-homed machines, this may be ambiguous if
several names may be supplied for several interfaces and/or IPv6 and
v4, but I still prefer using the selected value unchanged in order to
keep the network manager in control.

Whether hostnames ideally should be short names or FQDN's seems to be
an almost religious issue. I happen to be of the kind of person who
has always used FQDN's as hostname except on OS'es that did not allow
it. However, if the value from /etc/rc.conf is used, I'm less
concerned about what dhcpcd does in other cases.

- Erik
Post by Roy Marples
* dhcpcd will now assign a short hostname by default
To use a FQDN hostname, set this in dhcpcd.conf(5)
env hostname_fqdn=YES
This is the wrong default, too - hostname should always be FQDN.
This is far from universally agreed upon.
However, ISTM that if dhcpcd is going to set the hostname at all
(which is usually wrong) it should set the hostname the dhcp server
provides and not try to munge it.
Which hostname should dhcpcd set?
You can read the rest of my snipped comment directly above here
http://mail-index.netbsd.org/source-changes-d/2013/07/20/msg005999.html
TLDR: I justify the use of a short hostname with what I think are sound technical reasons.
imo, dhcpcd should not set a hostname at all, at least not by default.
Maybe it should only set it if no other hostname has been set?
Maybe you should at least read the first paragraph of dhcpcd(8) before commenting?
Roy
This update changes existing behavior, which may have unexpected
consequences when people upgrade. I observed pkg_chk failing to read a
pkgchk_… file because the hostname was changed after a reboot :-(
1. If hostname is set in /etc/rc.conf, I strongly think that this should be
set as the machine's hostname (FQDN or short or anything else). In this case
dhcpcd should not try to (re)set it. That keeps the system manager in
control.
2. If hostname is not set in /etc/rc.conf I see no problem in dhcpcd trying
to define and set a hostname, e.g. by using a value provided by the dhcp
server. For multi-homed machines, this may be ambiguous if several names may
be supplied for several interfaces and/or IPv6 and v4, but I still prefer
using the selected value unchanged in order to keep the network manager in
control.
Whether hostnames ideally should be short names or FQDN's seems to be an
almost religious issue. I happen to be of the kind of person who has always
used FQDN's as hostname except on OS'es that did not allow it. However, if
the value from /etc/rc.conf is used, I'm less concerned about what dhcpcd
does in other cases.
- Erik
* dhcpcd will now assign a short hostname by default
To use a FQDN hostname, set this in dhcpcd.conf(5)
env hostname_fqdn=YES
This is the wrong default, too - hostname should always be FQDN.
This is far from universally agreed upon.
However, ISTM that if dhcpcd is going to set the hostname at all
(which is usually wrong) it should set the hostname the dhcp server
provides and not try to munge it.
Which hostname should dhcpcd set?
You can read the rest of my snipped comment directly above here
http://mail-index.netbsd.org/source-changes-d/2013/07/20/msg005999.html
TLDR: I justify the use of a short hostname with what I think are sound
technical reasons.
imo, dhcpcd should not set a hostname at all, at least not by default.
Maybe it should only set it if no other hostname has been set?
Maybe you should at least read the first paragraph of dhcpcd(8) before
commenting?
Roy
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2013-07-23 09:15:03 UTC
Permalink
Post by Erik Bertelsen
This update changes existing behavior, which may have unexpected
consequences when people upgrade. I observed pkg_chk failing to read a
pkgchk_? file because the hostname was changed after a reboot :-(
If your hostname changed, and you did set it properly in rc.conf, then
there is a bug, as Roy has pointed out already: dhcpcd will NOT set a hostname
by default, UNLESS there is no hostname set.

Now, if you do not have set it in rc.conf, /etc/rc.d/network would not have
warned you about that if you have dhpcpcd configured to run later.

In this case only the change of behaviour might hit you, and the fix is
easy (either set hostname in rc.conf, probably best solution, or ask dhcpcd
to use fqdn, as roy described).

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Erik Bertelsen
2013-07-23 14:10:11 UTC
Permalink
Sorry to be insistent, but after another try, my situation (still) is:

Using netbsd-current/i386 updated yesterday, I have the problem (that
I have been seen for a few days) that the network interface (pcn0)
seems to start in state 'down'.

With the following complete contents of /etc/rc.conf (except for
leading comment lines):

---------/etc/rc.conf---------
if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
fi

# If this is not set to YES, the system will drop into single-user mode.
#
rc_configured=YES

# Add local overrides below
#
hostname=x8-nb-kmod.h.recerik.dk
dhcpcd=yes
wscons=YES
postfix=yes
sshd=yes

# pkgsrc:
dbus=yes
kdm=no
--------- end of /etc/rc.conf---------

the system starts up acknowledging the hostname
x8-nb-kmod.h.recerik.dk being set, but no IP addresses are assigned.

After issuing an 'ifconfig pcn0 up' command, ifconfig in a few seconds
reports that first IPv6, then IPv4 is configured as expected. Then
issuing the hostname command, it reports x8-nb-kmod.h.recerik.dk just
as expected, but a few seconds later, it reports just 'x8-nb-kmod'.

According to your message, is this the time to send a PR ?

- Erik
Post by Martin Husemann
Post by Erik Bertelsen
This update changes existing behavior, which may have unexpected
consequences when people upgrade. I observed pkg_chk failing to read a
pkgchk_? file because the hostname was changed after a reboot :-(
If your hostname changed, and you did set it properly in rc.conf, then
there is a bug, as Roy has pointed out already: dhcpcd will NOT set a hostname
by default, UNLESS there is no hostname set.
Now, if you do not have set it in rc.conf, /etc/rc.d/network would not have
warned you about that if you have dhpcpcd configured to run later.
In this case only the change of behaviour might hit you, and the fix is
easy (either set hostname in rc.conf, probably best solution, or ask dhcpcd
to use fqdn, as roy described).
Martin
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2013-07-23 14:11:48 UTC
Permalink
Post by Erik Bertelsen
According to your message, is this the time to send a PR ?
Yes, definitively!

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...