image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old February 12th, 2008, 08:32 PM
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
  #2  
Old February 21st, 2008, 01:50 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,109
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
I noticed the same behaviour, which seemed to be caused by my DHCP controller (i.e., my router).

I have an iBook with two interfaces (iBookEN and iBookAP for ethernet and airport respectively). I use two pipes for a complex QoS implementation.

I noticed that, even though my hostname in System Preferences was iBook, it would take on the hostname given by my DHCP controller (or, more specifically, the one provided as a DHCP Client ID, given above).

But, after having used two routers (a Linksys WRT54G-CA v6 with dd-wrt custom firmware and a DLink DI-624 with 2.76) I have only experienced hostname changes with the Linksys, not with the DLink.
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• iMac G4 TFT 700 MHz | MacOS X 10.3.9 | 768 MB RAM, 40 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 05:15 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.