Sets hostname but doesn't ensure it's in /etc/hosts

Bug #163798 reported by Loïc Minier
2
Affects Status Importance Assigned to Milestone
samsung-q1-ultra-config (Ubuntu)
Fix Released
Undecided
Unassigned
ume-config-common (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi,

While testing new hardy-based images, some programs such as sudo would complain about the host being unknown. It seems this is due to the hostname being set to "mobile-" + anything but this name not being present in /etc/hosts.

Bye,

Revision history for this message
Loïc Minier (lool) wrote :

Analysis of the current system:
/etc/hostname is generated by ume-config-common's postinst, to set the hostname to "mobile-0000".

/etc/init.d/hostname.sh, usually provided by initscripts, is overriden by ume-config-samsung; the difference in this script is that when the hostname matches with "^mobile-....", it will set to "mobile-" + four first hex digits of the MD5 sum of the first line of output of ifconfig eth0. This will generate a different hostname for some different MAC addresses.

Revision history for this message
Loïc Minier (lool) wrote :

Proposed fix:
I propose we stop generating a bogus magic /etc/hostname and stop overriding /etc/init.d/hostname.sh as this seems dangerous; instead we could have a one time process during the first startup/boot (this could be implemented with an init script + a file in /var/lib) to setup such things.

The requirement of doing some actions the first time the system boots is probably also one for the mobile-setup-wizard blueprint; if we can live without a hostname set until the first time setup pops up, we could defer generation of /etc/hostname at this point.

Perhaps we can reuse some infrastructure if we base the initial setup on udebs and e.g. use netcfg and preseeding to set the hostname. We could ship one partial seed in ume-config-common and a more specific one (if needed) in ume-config-samsung-q1-ultra; these seeds would set the default values for the mini "first boot" d-i and we could easily decide whether or not to ask the end user about the hostname (we probably don't want to ask).

Revision history for this message
Loïc Minier (lool) wrote :

NB: whatever generates /etc/hostname should probably also generate /etc/hosts or should at least make sure that the hostname is listed therein.

Loïc Minier (lool)
Changed in samsung-q1-ultra-config:
status: New → Fix Released
Changed in ume-config-common:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.