NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/55011: dhcpcd(8) sets "localhost" as hostname



The following reply was made to PR bin/55011; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: bin/55011: dhcpcd(8) sets "localhost" as hostname
Date: Mon, 24 Feb 2020 20:02:49 +0900

 > >Synopsis:       dhcpcd(8) sets "localhost" as hostname
  :
 > Tweak /libexec/dhcp-hooks/30-hostname ?
 
 Replacing all /libexec/dhcpcd-hooks scripts with NetBSD 6.1.5 ones
 makes dhcpcd(8) use hostname provided by DHCP server:
 
 ---
 Mon Feb 24 18:48:48 UTC 2020
 Feb 24 18:48:51  getty[527]: /dev/tty00: Device not configured
 
 NetBSD/cobalt (Amnesiac) (ttyZ0)
 
 login: root
 Feb 24 18:48:53  login: ROOT LOGIN (root) on tty ttyZ0
 Last login: Mon Feb 24 18:40:37 2020 on ttyZ0
 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.
 
 NetBSD 9.0 (GENERIC) #0: Mon Feb 24 03:01:07 JST 2020
 
 Welcome to NetBSD!
 
 We recommend that you create a non-root account and use su(1) for root access.
 # rm -f /var/db/dhcpcd/*
 # ifconfig tlp0 up
 # dhcpcd -d
 dhcpcd-8.1.6 starting
 tlp0: executing `/libexec/dhcpcd-run-hooks' PREINIT
 tlp0: executing `/libexec/dhcpcd-run-hooks' CARRIER
 DUID 00:01:00:01:25:e6:d7:2b:00:10:e0:00:09:46
 tlp0: IAID e0:00:09:46
 tlp0: delaying IPv6 router solicitation for 0.0 seconds
 tlp0: delaying IPv4 for 0.5 seconds
 tlp0: soliciting an IPv6 router
 tlp0: sending Router Solicitation
 tlp0: soliciting a DHCP lease
 tlp0: sending DISCOVER (xid 0xa6d2fd80), next in 3.9 seconds
 tlp0: offered 10.0.0.155 from 10.0.0.254 `10.0.0.254'
 tlp0: sending REQUEST (xid 0xa6d2fd80), next in 3.6 seconds
 tlp0: acknowledged 10.0.0.155 from 10.0.0.254 `10.0.0.254'
 tlp0: adding IP address 10.0.0.155/8 broadcast 10.255.255.255
 tlp0: sending Router Solicitation
 tlp0: DAD completed for 10.0.0.155
 tlp0: leased 10.0.0.155 for 600 seconds
 tlp0: renew in 300 seconds, rebind in 525 seconds
 tlp0: writing lease `/var/db/dhcpcd/tlp0.lease'
 tlp0: IP address 10.0.0.155/8 already exists
 tlp0: adding route to 10.0.0.0/8
 tlp0: adding default route via 10.0.0.254
 tlp0: executing `/libexec/dhcpcd-run-hooks' BOUND
 forking to background
 forked to background, child pid 644
 # hostname
 q-155.netbsd.org
 # ls -l /libexec/dhcpcd-hooks
 total 18
 -rw-r--r--  1 root  wheel   202 Sep 29  2014 01-test
 -rw-r--r--  1 root  wheel   108 Sep 29  2014 02-dump
 -rw-r--r--  1 root  wheel   981 Sep 29  2014 10-mtu
 -rw-r--r--  1 root  wheel  3850 Sep 29  2014 20-resolv.conf
 -rw-r--r--  1 root  wheel   649 Sep 29  2014 29-lookup-hostname
 -rw-r--r--  1 root  wheel  1050 Sep 29  2014 30-hostname
 -rw-r--r--  1 root  wheel  2487 Sep 29  2014 50-ntp.conf
 # 
 ---
 
 On the other hand 7.2 ones set localhost:
 ---
 Mon Feb 24 18:56:47 UTC 2020
 Feb 24 18:56:50  getty[573]: /dev/tty00: Device not configured
 
 NetBSD/cobalt (Amnesiac) (ttyZ0)
 
 login: root
 Feb 24 18:57:42  login: ROOT LOGIN (root) on tty ttyZ0
 Last login: Mon Feb 24 18:48:53 2020 on ttyZ0
 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.
 
 NetBSD 9.0 (GENERIC) #0: Mon Feb 24 03:01:07 JST 2020
 
 Welcome to NetBSD!
 
 We recommend that you create a non-root account and use su(1) for root access.
 # rm -f /var/db/dhcpcd/*
 # ifconfig tlp0 up
 # dhcpcd -d
 dhcpcd-8.1.6 starting
 tlp0: executing `/libexec/dhcpcd-run-hooks' PREINIT
 tlp0: executing `/libexec/dhcpcd-run-hooks' CARRIER
 DUID 00:01:00:01:25:e6:d9:3b:00:10:e0:00:09:46
 tlp0: IAID e0:00:09:46
 tlp0: delaying IPv6 router solicitation for 0.7 seconds
 tlp0: delaying IPv4 for 0.8 seconds
 tlp0: soliciting an IPv6 router
 tlp0: sending Router Solicitation
 tlp0: soliciting a DHCP lease
 tlp0: sending DISCOVER (xid 0x55bbbf62), next in 3.0 seconds
 tlp0: offered 10.0.0.156 from 10.0.0.254 `10.0.0.254'
 tlp0: sending REQUEST (xid 0x55bbbf62), next in 3.8 seconds
 tlp0: acknowledged 10.0.0.156 from 10.0.0.254 `10.0.0.254'
 tlp0: adding IP address 10.0.0.156/8 broadcast 10.255.255.255
 tlp0: sending Router Solicitation
 tlp0: DAD completed for 10.0.0.156
 tlp0: leased 10.0.0.156 for 600 seconds
 tlp0: renew in 300 seconds, rebind in 525 seconds
 tlp0: writing lease `/var/db/dhcpcd/tlp0.lease'
 tlp0: IP address 10.0.0.156/8 already exists
 tlp0: adding route to 10.0.0.0/8
 tlp0: adding default route via 10.0.0.254
 tlp0: executing `/libexec/dhcpcd-run-hooks' BOUND
 tlp0: Setting hostname: localhost
 forking to background
 forked to background, child pid 663
 # hostname
 localhost
 # ls -l /libexec/dhcpcd-hooks
 total 18
 -rw-r--r--  1 root  wheel   300 Aug 29  2018 01-test
 -rw-r--r--  1 root  wheel   120 Aug 29  2018 02-dump
 -rw-r--r--  1 root  wheel  5471 Aug 29  2018 20-resolv.conf
 -rw-r--r--  1 root  wheel  3733 Aug 29  2018 30-hostname
 -rw-r--r--  1 root  wheel  3432 Aug 29  2018 50-ntp.conf
 # 
 ---
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index