Removing /etc/hostname results in failed first login attempt
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lightdm (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
We assign hostnames to machines using dhcp. For this to work in 12.04 you seem to have to remove /etc/hostname (or have it empty, the behaviour is the same). However doing this results in the first attempted graphical login after boot failing. I have reproduced this behaviour across several machines, from upgrades and clean installations, and can turn it on and off by removing /etc/hostname, or making it non-empty.
The symptoms are:
- At the greeter prompt the hostname at screen top left is set to localhost
- If I switch to a console prompt the hostname displays correctly (i.e. not localhost)
- After successfully entering a uname/pwd you briefly get a desktop for one second or so, then it drops to the console for half a sec or so, then the greeter re-appears.
- Once the greeter re-appears the hostname will be set correctly at screen top left, and subsequents logins successfully proceed to the desktop
.x-session-errors has some lines about xrdb being unable to open display:0, other logs in /var/log/lightdm/ seem ok, but I'll include them too. I've run strace -ff -p <lightdm> but am not familiar enough with the graphical login process to make much headway there, and I've yet to turn up an obvious - to me - error, though paging through strace output tends to make ones eyes glaze over :)
Curiously I can't replicate this in a VBox VM. Fresh install, exact same configuration but it displays the hostname properly at screen top left and the first login proceeds normally. I will make the VM name and dhcp hostname different and see if this reveals the bug.
Regards
Thank you for your bug report, the session log suggests the issue is not lightdm but rather the xorg session cookie (but maybe lightdm doesn't pick up the correct hostname to create the Xauthority)