Persistent hostname issues



Hi,

I'm really confused how the hostname things are handled in NM. I'm trying to 
understand looking through the code but I'm completely lost as there are 
methods which wraps methods which wraps methods, etc.

Here's the setup:

* NetworkManager 0.8.1
* DHCP client is dhcpcd 5.2.7
* plugin used: only keyfile
* All hostname related hooks are removed from dhcpcd package

Problem:

There are user reports which complains that the machine hostname changes once 
the machine acquires an IP from DHCP. Same reports tells that removing option 
host_name from /etc/dhcpcd.conf fixes the issue.

Questions:

1) Digging through the code, I can't find any place where dhcpcd.conf is 
parsed! Am I wrong? Can this be a false positive?

2) in src/dhcp-manager/nm-dhcp-manager.c: nm_dhcp_manager_start_ip4() it says: 
"If we're asked to send the hostname to DHCP server..". What's the way of 
asking NM to send the hostname to DHCP server? On my system dhcpcd never gets 
the -h parameter as the hostname is NULL. What does 
nm_setting_ip4_config_get_dhcp_send_hostname() returns?

3) I tried to write a plugin for persistent hostname support. I copied ifcfg-
suse and modified it to support Pardus. I'm searching "option.*host_name" in 
dhcpcd.conf for hostname_is_dynamic() method and I'm reading/writing the 
specific hostname file of Pardus. But what should I expect from this plugin? 

Should it update the hostname file when I call glibc's sethostname()?
Should it update machine's hostname when I modify the hostname file?

Currently it detects the changes in the hostname file but nothing changes in 
the system. I searched for plugin_set_hostname() in the NM code but can't find 
it, wrapped thing are all around :(

Thanks a lot!



---
Ozan Çağlayan
TUBITAK/UEKAE - Pardus Linux
http://www.pardus.org.tr/eng


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]