Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#32480 - [dhcpcd] server-assigned hostname won't stick on boot

Attached to Project: Arch Linux
Opened by travis (tladuke) - Monday, 05 November 2012, 19:02 GMT
Last edited by Ronald van Haren (pressh) - Monday, 14 October 2013, 19:16 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Ronald van Haren (pressh)
Architecture i686
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
When the system finishes booting the hostname is "localhost", not the dhcp server assigned hostname.
In the journal, the logs start with localhost, there's one line with the server-assigned hostname, then it goes back to being localhost.
Restarting the network service will set the hostname to what the server assigns.
This (boot finishes with hostname=localhost and restarting the service fixes) happens both with the dhcpcd@eth0 service, or with netcfg.service.

I checked this bugtracker and freedesktop and can't find anything about hostname.

I need to pxe boot the same image on multiple clients and this is the last thing blocking me.

Additional info:
* package version(s)
Name : dhcpcd
Version : 5.6.2-1

Name : systemd
Version : 195-2

Name : netcfg
Version : 3.0-1

* config and/or log files etc.


Steps to reproduce:
Set up dnsmasq to assign hostnames:

/etc/dnsmasq.conf
#something like
interface=eth0
dhcp-range=192.168.10.101,192.168.10.140,4h
dhcp-host=01:23:45:67:89:ab,host-3 #client's mac address

boot client


Here's a portion of the boot journal:
Nov 02 19:15:43 localhost systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() o
Nov 02 19:15:44 localhost kernel: e1000e 0000:00:19.0: irq 40 for MSI/MSI-X
Nov 02 19:15:44 localhost kernel: e1000e 0000:00:19.0: irq 40 for MSI/MSI-X
Nov 02 19:15:44 localhost kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Nov 02 19:15:46 localhost kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: R
Nov 02 19:15:46 localhost kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Nov 02 19:15:46 localhost dhcpcd[253]: version 5.6.2 starting
Nov 02 19:15:46 localhost dhcpcd[253]: eth0: sending IPv6 Router Solicitation
Nov 02 19:15:46 localhost dhcpcd[253]: eth0: sendmsg: Cannot assign requested address
Nov 02 19:15:47 localhost dhcpcd[253]: eth0: broadcasting for a lease
Nov 02 19:15:47 localhost dhcpcd[253]: eth0: offered 192.168.10.120 from 192.168.10.1
Nov 02 19:15:47 localhost dhcpcd[253]: eth0: acknowledged 192.168.10.120 from 192.168.10.1
Nov 02 19:15:47 localhost dhcpcd[253]: eth0: checking for 192.168.10.120
Nov 02 19:15:50 localhost dhcpcd[253]: eth0: sending IPv6 Router Solicitation
Nov 02 19:15:52 localhost dhcpcd[253]: eth0: leased 192.168.10.120 for 14400 seconds
Nov 02 19:15:52 IC-1 dhcpcd[253]: forked to background, child pid 282
Nov 02 19:15:53 localhost netcfg-daemon[161]: :: ethernet-dhcp up [done]
Nov 02 19:15:53 localhost systemd[1]: Received SIGCHLD from PID 161 (netcfg-daemon).
Nov 02 19:15:53 localhost systemd[1]: Got SIGCHLD for process 161 (netcfg-daemon)
Nov 02 19:15:53 localhost systemd[1]: Child 161 died (code=exited, status=0/SUCCESS)
Nov 02 19:15:53 localhost systemd[1]: Child 161 belongs to netcfg.service
Nov 02 19:15:53 localhost systemd[1]: netcfg.service: main process exited, code=exited, status=0/SUC
Nov 02 19:15:53 localhost systemd[1]: netcfg.service changed start -> exited
Nov 02 19:15:53 localhost systemd[1]: Job netcfg.service/start finished, result=done
Nov 02 19:15:53 localhost systemd[1]: Started Netcfg multi-profile daemon.
Nov 02 19:15:53 localhost systemd[1]: Starting Network.
Nov 02 19:15:53 localhost systemd[1]: network.target changed dead -> active
Nov 02 19:15:53 localhost systemd[1]: Job network.target/start finished, result=done
Nov 02 19:15:53 localhost systemd[1]: Reached target Network.
This task depends upon

Closed by  Ronald van Haren (pressh)
Monday, 14 October 2013, 19:16 GMT
Reason for closing:  None
Comment by travis (tladuke) - Tuesday, 06 November 2012, 22:32 GMT
I added
hostnamectl set-hostname "$1"$
to _hostname() in /usr/lib/dhcpcd/dhcpcd-hooks/30-hostname

my hostname stays as the dhcp assigned name for a litttle long, but then eventually gets clobbered again. by what?
http://sprunge.us/CdZM
Comment by travis (tladuke) - Wednesday, 07 November 2012, 01:19 GMT
By something in netcfg apparently.
I switched back to dhcpcd@eth0.service and with using hostnamectl instead of hostname or echoing into /proc/sys/kernel/hostname... it seems to be working.

Loading...