2017-03-29 13:17 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0012828CentOS-7dracutpublic2017-02-15 21:35
Reportermwmanley 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Product Version7.3.1611 
Target VersionFixed in Version 
Summary0012828: dracut/anaconda do not set system hostname from ip kickstart parameter
DescriptionWhen booting a CentOS 7.3.1611 image with the following kickstart parameters:

Feb 15 21:01:46 localhost kernel: Command line: ks=http://kickstart/pub/kickstart/conf/prd/7_template.cfg biosdevname=0 net.ifnames=0 ksdevice=eth0 load_ramdisk=1 initrd=centos/7.3/initrd.img ip=::::centos7::dhcp rd.debug BOOTIF=01-00-50-56-a2-3c-9a BOOT_IMAGE=centos/7.3/vmlinuz

the hostname ("centos7") gets somehow swallowed somewhere. When the system boots I can see the systemd does not have a name:

Feb 15 21:01:46 localhost systemd[1]: No hostname configured.
Feb 15 21:01:46 localhost systemd[1]: Set hostname to <localhost>.

I can see all these kickstart parameters come from our kickstart server and dracut is setting the host name down the line:

Feb 15 21:01:46 localhost dracut-cmdline[79]: //lib/net-lib.sh@494(ip_to_var): '[' -n centos7 ']'
Feb 15 21:01:46 localhost dracut-cmdline[79]: //lib/net-lib.sh@494(ip_to_var): hostname=centos7

Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@440(ip_to_var): unset ip srv gw mask hostname dev autoconf macaddr mtu dns1 dns2
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@442(ip_to_var): '[' 7 -eq 0 ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@447(ip_to_var): '[' 7 -eq 1 ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@475(ip_to_var): '[' '' = dhcp -o '' = on -o '' = any -o '' = dhcp6 -o '' = auto6 ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@490(ip_to_var): '[' -n '' ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@491(ip_to_var): '[' -n '' ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@492(ip_to_var): '[' -n '' ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@493(ip_to_var): '[' -n '' ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@494(ip_to_var): '[' -n centos7 ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@494(ip_to_var): hostname=centos7
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@495(ip_to_var): '[' -n '' ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@496(ip_to_var): '[' -n dhcp ']'
Feb 15 21:01:47 localhost dracut-initqueue[541]: /lib/net-lib.sh@496(ip_to_var): autoconf=dhcp

then later it seems to appear here:

Feb 15 21:01:50 localhost dracut-initqueue[541]: //sbin/ifup@400(): '[' centos7 ']'
Feb 15 21:01:50 localhost dracut-initqueue[541]: //sbin/ifup@400(): echo hostname=centos7

and here:

Feb 15 21:01:50 localhost dracut-initqueue[541]: //lib/net-lib.sh@121(setup_net): '[' -e /tmp/net.eth0.hostname ']'
Feb 15 21:01:50 localhost dracut-initqueue[541]: //lib/net-lib.sh@122(setup_net): '[' -e /tmp/net.eth0.override ']'
Feb 15 21:01:50 localhost dracut-initqueue[541]: //lib/net-lib.sh@122(setup_net): . /tmp/net.eth0.override
Feb 15 21:01:50 localhost dracut-initqueue[541]: ///tmp/net.eth0.override@1(source): hostname=centos7

Then NetworkManager comes along and does not have this name:

Feb 15 21:02:08 localhost.localdomain systemd-hostnamed[1373]: Changed host name to 'localhost.localdomain'
Feb 15 21:02:08 localhost NetworkManager[1345]: <info> [1487192528.6887] settings: hostname: using hostnamed
Feb 15 21:02:08 localhost NetworkManager[1345]: <info> [1487192528.6887] settings: hostname changed from (none) to ""
Feb 15 21:02:08 localhost NetworkManager[1345]: <debug> [1487192528.6887] dispatcher: (1) dispatching action 'hostname'
Feb 15 21:02:08 localhost.localdomain NetworkManager[1345]: <info> [1487192528.7492] policy: setting system hostname to 'localhost.localdomain' (no default device)

As a result, I am left with a host registering itself in DNS (we use DDNS) as "localhost."

This used to work in CentOS 7.2 before systemd took over this function. Is there some issue with dracut and systemd not speaking to each other? I checked and re-checked all the anaconda and dracut documentation and do not see any issues there.
Steps To ReproduceKickstart of this host or any other host will result in "localhost"
Additional InformationI do not specify a hostname in the kickstart configuration files. I never had to in the past.
TagsNo tags attached.
abrt_hash
URL
Attached Files

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2017-02-15 21:35 mwmanley New Issue
+Issue History