Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 577002

Summary: sys-apps/systemd Transient Hostname causes GNOME crashes and other havoc
Product: Gentoo Linux Reporter: Rok Kralj <gentoo>
Component: [OLD] GNOMEAssignee: Gentoo systemd Team <systemd>
Status: RESOLVED CANTFIX    
Severity: major    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=577150
Whiteboard:
Package list:
Runtime testing required: ---

Description Rok Kralj 2016-03-10 21:45:50 UTC
Q: When does it occur?

A: When I connect to specific Wi-Fi. Apparently the transient hostname gets set to "unknown" + some random string.

~/w/a git:(master) ✗ hostnamectl
   Static hostname: rok-laptop
Transient hostname: unknownc417fe03cb97
         Icon name: computer-laptop
           Chassis: laptop

Q: What does it cause?

1. GNOME does sometimes crash. No logs anywhere, the graphical environment just crashes, dropping you to the virtual terminal. I am positive this is the cause of this, because this has happened over 100 times, everytime with that Wi-Fi.

2. Java starts reporting UnknownHostException.

java.net.UnknownHostException: unknownc417fe03cb97: unknownc417fe03cb97: unknown error
	at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
	at scala.tools.nsc.io.Socket$.localhost(Socket.scala:28)
	at scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:175)
	at scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:190)


Q: Does anybody have any idea?
Comment 1 Mike Gilbert gentoo-dev 2016-03-11 01:54:21 UTC
Yeah, changing the hostname is known to cause issues with X11.

You can set UseHostname=false in your networkd config to prevent that from happening.
Comment 2 Rok Kralj 2016-03-11 08:38:55 UTC
Sadly, I have done that months ago, the sitiation is exactly the same:

# cat /etc/systemd/network/50-dhcp.network 
[Match]
Name=en*
 
[Network]
DHCP=yes
UseHostname=false
UseDomains=false


Even if it worked, it should be by default set to false.
Comment 3 Rok Kralj 2016-03-11 09:12:03 UTC
I have finally realised that match should be wl* not en*. Thanks. But anyways, I think this should be off by default, given the harsh consequences, therefore I will just leave this open.

Thanks again.
Comment 4 Mike Gilbert gentoo-dev 2016-03-12 04:37:15 UTC
That's a battle to be fought with systemd upstream.
Comment 5 Rok Kralj 2016-03-12 07:21:04 UTC
Gentoo can provide more sensible default config files. X11 crashes are not OK.
Comment 6 Mike Gilbert gentoo-dev 2016-03-12 14:06:03 UTC
As far as I can tell, the only way to configure networkd is via *.network files in /etc/systemd/network. Gentoo does not ship any network files by default, and it would be inappropriate to do so.

Anyway, I suspect your crashes are occurring due to entries in ~/.Xauthority which are tied to your hostname. I have not found any reasonable solution we could implement as a Linux distro.

http://stackoverflow.com/questions/20611783/after-changing-hostname-gedit-not-open