Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Network manager changes hostname?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 818

PostPosted: Mon Aug 16, 2010 10:00 pm    Post subject: Network manager changes hostname? Reply with quote

I'm normally working off a wired ethernet connection. Today, I had occasion to use wireless and noticed some strange things going on. First of all, nearly every command run from the command line (e.g. vi) resulted in
Code:

_IceTransSocketUNIXConnect: Cannot connect to non-local host foo
_IceTransSocketUNIXConnect: Cannot connect to non-local host foo

As root, the equivalent is
Code:

No protocol specified
No protocol specified

Then I found that the hostname was changed from "foo" to "foo-3945" (I have an Intel 3945abg NIC), and this bit added to /etc/hosts:
Code:

127.0.0.1       foo-3945     localhost.localdomain   localhost

Looking at recent emerges, I believe this is networkmanager's doing (networkmanager-0.8.1-r1).

This behaviour is unexpected, and the IceTransSocketUNIXConnect errors quite annoying. Can anyone explain what's going on and how to stop the hostname from changing? The hostname is defined in /etc/conf.d/hostname, period, and no software has any business fiddling with it. Yes, I'm getting different IP addresses via dhcp on eth0 and wlan0, but that's no reason to change the hostname and break a lot of other stuff in the process.
Back to top
View user's profile Send private message
Dagger
Retired Dev
Retired Dev


Joined: 11 Jun 2003
Posts: 765
Location: UK

PostPosted: Tue Aug 17, 2010 9:08 am    Post subject: Reply with quote

If your DHCP server provides not only IP address but also hostname - NetworkManager will change it accordingly.

If you want, you can try gentoo-specyfic plugin for NM - which will honor all your Gentoo settings.

Bear in mind it's GSoC work-in-progress and there might still be some bugs. It's already part of of NM-0.8.1-r1 shipped by us. Very shortly I'll be pushing updated version (the one which we presented for upstream integration).

To enable it, please change the following:
edit /etc/NetworkManager/nm-system-settings.conf
Add ifnet to plugin list - it should look like:
Code:
plugins=keyfile,ifnet

_________________
95% of all computer errors occur between chair and keyboard (TM)
Join the FSF as an Associate Member!
Post under CC license.
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 818

PostPosted: Thu Aug 19, 2010 7:41 pm    Post subject: Reply with quote

I'll revisit this at a later point. The latest NetworkManager is horribly broken. I set up an x86_64 system on a new partition and found after an update that I would not get any network connections at all. Also found out that Networkmanger (or nm-applet) overwrites /etc/conf.d/net, which is *not* nice. So I went back to my old, 32-bit system and realised it is broken here, too. I removed everything nm and re-emerged 0.7.2, i.e. masking the 0.8.x versions. All back to normal, and luckily I was able to recover my original conf.d/net - it's handy to have a network configuration around that works. Will do the same on the 64-bit system.

I think I had nm unmasked originally because nm-vpnc was masked.

I don't think the dhcp server is involved, the hostname I ended up with was foo-3945 - the dhcp server
doesn't know this laptop has a 3945 nic.

Thanks :)
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 818

PostPosted: Sat Aug 21, 2010 4:36 pm    Post subject: Reply with quote

I'm wondering if anything else is at play. Now, under networkmanager 0.7.2, the hostname situation is
still broken. In disregard of the /etc/conf.d/hostname setting, after boot my machine ends up with a
hostname of localhost.localdomain. Despite the real hostname being set in /etc/hosts for 127.0.0.1.
Now I've dumped networkmanager completely.
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 818

PostPosted: Thu Aug 26, 2010 10:16 pm    Post subject: Reply with quote

I'm a sucker, I just can't let it go ...

Back to networkmanager-0.8. Enabling wireless while leaving the wired interface connected, the hostname remains unchanged. Enabling the wireless NIC with the wired NIC unplugged, the hostname changes to hostname-3945. So far so bad - this is pretty much the same behaviour as https://bugs.gentoo.org/176873, first reported 3 years ago, and supposedly fixed in 0.8. Regression?

Following http://live.gnome.org/NetworkManager/SystemSettings, I can work around it by setting the hostname explicitly in /etc/NetworkManager/nm-system-settings.conf, but that's kinda ugly. And I haven't tested whether it works across a reboot, i.e. wireless NIC enabled and wired NIC unplugged.
Back to top
View user's profile Send private message
axisofadvance
n00b
n00b


Joined: 22 Oct 2018
Posts: 12

PostPosted: Tue Nov 20, 2018 4:22 am    Post subject: Reply with quote

My apologies if I'm committing a faux-pas by exhuming this thread, but I'm experiencing an (almost) identical issue.

I'm not running NetworkManager per se, but in a 2-day-old switch from wired to wireless networking, I did recently go through the motions of configuring the wpa_supplicant and dhcpcd.

I started experiencing the issue noted by OP in the first post, namely while in KDE, every time I start vi and exit it, I see this on the command line:

Code:
_IceTransSocketUNIXConnect:Cannot connect to non-local host <myhostname>
_IceTransSocketUNIXConnect:Cannot connect to non-local host <myhostname>
No protocol specified
No protocol specified
No protocol specified


I think the issue is somewhere with dhcpcd, and specifically revolves around a conflict in hostname assignment/management, however I'm not really sure how to go about resolving this. How can I ensure that it or another network manager isn't creating conflicts with what's in say /etc/hosts and what should be present at boot time? Should I be adding wpa_supplicant as a boot runlevel service (i.e. ensuring it's present in /etc/init.d)?

Any pointers are greatly appreciated.

Thank you!
Back to top
View user's profile Send private message
mirekm
Apprentice
Apprentice


Joined: 12 Feb 2004
Posts: 198
Location: Gliwice

PostPosted: Tue Nov 20, 2018 7:52 am    Post subject: Reply with quote

You can try to create a file:
/etc/dhcp/dhclient.conf

with following contents:
Code:

send host-name = "yourHostName";


This should help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum