View Single Post
  #1  
Old February 12th, 2008, 08:32 PM
waiting_for_OSX waiting_for_OSX is offline
Registered User
 
Join Date: Mar 2002
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
waiting_for_OSX is on a distinguished road
hostname strange behavior

I'm using Leopard 10.5.2, MBP.

When I was using 10.4.something, I set the hostname to X using system preferences -> sharing. Everything worked fine.

Months later, after upgrading to 10.5.1, I set the hostname to Y by the same method. This appeared to work properly. I then upgraded later to 10.5.2.

When I started the terminal I discovered my bash shell prompt, which is defined as:

$echo $PS1
\h:\W \u\$

still said

X:~ myname$

I discovered my /etc/hostname file still thought my hostname was X.
I su root, set the hostname to Y with the hostname command, restart the terminal app and then my bash shell prompt said:

Y:~ myname$

All was good. Closing the terminal, I then went back to system preferences -> sharing, and set the hostname to Z. I restarted the terminal, and my prompt was back to

X:~ myname$

Which was very surprising. Not only was it not what I expected, it wasn't the error I would have expected.

Does anyone know how hostname is getting changed, or how to fix this problem?
Reply With Quote