Hostname "Chicken and Egg"

Bob Kinney bc98kinney at yahoo.com
Thu Dec 16 23:01:55 UTC 2004


Happy Holidays all--

I'm running RH9, and recently switched from being directly connected to
the internet (dhcp giving me a publicly routed address) to being behind
a router.

I reconfigured my IP address to be a static, private one now, and my 
hostname now comes up as "localhost.localdomain".  I'm trying to name the
host "vectra".

Looking at the man page for hostname, it says that:
" The  host  name  is   usually   set   once   at   system   startup   in
       /etc/rc.d/rc.inet1  or  /etc/init.d/boot  (normally by reading the con-
       tents of a file which contains the host name, e.g.  /etc/hostname)."

Although the files mentioned aren't there, I found in /etc/rc.sysinit
a section that seems to set the hostname by *calling* /bin/hostname.  
 >>
HOSTNAME=`/bin/hostname`
if [ -f /etc/sysconfig/network ]; then
    . /etc/sysconfig/network
else
    NETWORKING=no
fi
if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
    HOSTNAME=localhost
fi
 <<


[root at localhost init.d]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
[root at localhost init.d]#


It would seem that the hostname is being set either by the
/etc/sysconfig/network file, or by the fallout case listed in
/etc/rc.sysinit (if -z $HOSTNAME ...).

I don't know why the hostname command would fail:

[root at localhost init.d]# cat /etc/hostname
vectra
[root at localhost init.d]#

Also, what does the line ". /etc/sysconfig/network" do?
Is "." (dot) a command?

--bk




		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 




More information about the Redhat-install-list mailing list