PDA

View Full Version : try to change hostname but logout caused the system to hang



centguy
27th December 2008, 11:02 AM
I have installed F10.

I intend to change the hostname by simply login as root and type "hostname f10"

but when I logout as a normal user, the system hang, Clt-Alt-Fx , x = 1,2,3,...
does not respond.

I had no choice but to press the power switch.

Why would root's "hostname f10" cause the problem ?


I learn "hostname f10" trick from
http://www.linuxforums.org/forum/redhat-fedora-linux-help/16434-how-change-hostname.html

but is this a valid way of changing the hostname ?

Is there any easier to change the hostname than editing manually /etc/sysconfig/network ?
I mean is the a shortcut such as system-config-something ? or Top Menu -> System -> Administration -> something or something like that ?

Thanks for your response.

centguy
27th December 2008, 06:01 PM
I did system-config-network, change the default hostname to f10-32-dell under the DNS field.

after reboot, the NetworkManager icon has a cross sign, signaling that internet connectivity is
broken.

when I issue system-config-network again, a window with the following content appeared:


Error while parsing /etc/hosts
Wrong Alias on line 3
Wrong Alias on line 4




while /etc/hosts is
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost f10-32-dell
::1 localhost.localdomain localhost6 localhost f10-32-dell


I am rather disappointed by F10 right now.. A simple hostname change made me reinstall F10 at least 3 times and I am still not making any progress.. I don't have so much time to burn just like that!!

It seems F10 or F9 NetworkManager is easily confused !! Bugger!

marcrblevins
28th December 2008, 02:00 AM
Use your fav editor on the /etc/hosts file, should be tabs between each host values. Leave the ::1 line alone.


# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 kiriyamablevins.dyndns.org kiriyamablevins localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

You can mod the ::1 line but don't need it if you don't have a ip6v broker account.

nkd
28th December 2008, 04:45 AM
change the hostname in the /etc/sysconfig/network file as under:-

HOSTNAME=yourNewHostNameHere
Then you have to change the /etc/hosts file accordingly
Finally check up the DNS tab of the network configuation GUI, it should match the entries in /etc/hosts file and the /etc/sysconfig/network file.

Otherwise gui login takes a very long time.....seems like it has got hung.

that should be all
ni****h

centguy
28th December 2008, 08:39 AM
Back in RedHat 7.3 days, I know editing /etc/hosts and /etc/sysconfig/network worked, I still have
notes to refer to.

I thought I shall learn some new tools (e.g., system-config-network) but failed miserably. It seems the easiest way is to use vi to edit /etc/hosts and /etc/sysconfig/network rather than that system-config-network that breaks the NetworkManager. I am not network expert and I think I should shy way from finding out why system-config-network did not work. Life is too short to keep trying out new things!

weitjong
28th December 2008, 09:23 AM
I have been bitten by system-config-network once or twice that after modifying some network settings through it, it silently unticked the "Controled by NetworkManager" option. Thus, on the next reboot the NetworkManager would not even attempt to manage the wired connection anymore. Tick this option back gives back the control to NetworkManager and always solve the problem for me.

mk27
28th December 2008, 09:25 AM
Back in RedHat 7.3 days, I know editing /etc/hosts and /etc/sysconfig/network worked, I still have
notes to refer to. It seems the easiest way is to use vi to edit /etc/hosts and /etc/sysconfig/network Life is too short to keep trying out new things!

Dude, manually editing text files will always be a better way to go because that is all that these tools do anyway. I do GUI programming. You're not going to learn anything from them except how some particular interface works. There is a lot of "dumbing down" of the user that's been going on with linux, as I think you've noticed.

X is great because it provides a much nicer place for a terminal and adds the possibility of apps that need graphix, like the web browser. All this additional windoze style point and click crap is just that and everyone should know it. I actually guarantee there's LOTS to be learned from running console only for as long as you can stand it. Another thing is going over all those /etc/rc.d scripts that launch a slew of daemons most normal people don't need -- why an at home desktop needs a "Network Manager" I don't know. The harder you look at the runlevel scripts, the more obscene they become.



ifconfig eth0 up
dhclient eth0

If your text config files (etc/resolve.conf, hosts, host.allow, hosts.deny) are right, it's done. Setting the hostname, as you said, should be simple and is more or less irrelevent anyway.