Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 3906 - /etc/HOSTNAME
Summary: /etc/HOSTNAME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-07-06 01:20 UTC by Marc MERLIN
Modified: 2014-03-17 02:09 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-07-29 17:11:10 UTC

Attachments (Terms of Use)

Description Marc MERLIN 1999-07-06 01:20:47 UTC
My first issue is this (in /etc/rc.d/rc.sysinit)

if [ ! -f /etc/HOSTNAME ]; then
    echo ${HOSTNAME} > /etc/HOSTNAME

This has been there since the first RH releases and as far
as I can tell serves no purpose whatsoever, except offering
compatibility with slackware, which stored the hostname
there. This might have made some sense in the RH 2.x days,
but today, it's _really_ obsolete.
Also, my main issue with this is that if the hostname is
ever changed, /etc/HOSTNAME isn't updated. It looks like
it's a kind of misfeature that stayed there because no one
really knows what the original purpose was anyway...

It's not a huge issue, but a long of people wonder what this
is for and spend time trying to find out :-)

Comment 1 Cristian Gafton 1999-07-29 07:28:59 UTC
assigned to notting. We should either keep /etc/HOSTNAME in sync or
get rid of it altogether.

Comment 2 Bill Nottingham 1999-07-29 15:36:59 UTC
Actually, /etc/HOSTNAME is updated by the network initscripts
if it's set, and in the latest initscripts will be updated
unconditionally at boot.

Comment 3 Marc MERLIN 1999-07-29 16:49:59 UTC
You're right, I missed that reference.

From a cursory look, it seems that it will only update /etc/HOSTNAME
if you use BOOTP (and maybe DHCP), but if I change my hostname in
/etc/sysconfig/network and reboot, /etc/HOSTNAME keeps the old value.

If you decide to keep it around (if you believe there is still a
reason for it to be there), you would still need an unconditional
echo ${HOSTNAME} > /etc/HOSTNAME
in /etc/rc.d/rc.sysinit

Comment 4 Bill Nottingham 1999-07-29 17:11:59 UTC
Yup, will be in next initscripts release.

Comment 5 Aleksey Nogin 2000-08-07 17:23:10 UTC
How about getting rid of /etc/HOSTNAME? I am currently running a cluster where
all "slave" nodes mount a shared root fs from the "master" node. Everything
works fine, but /etc/HOSTNAME gets created with random values (usually - the
name of the slae that was booted last).

Note You need to log in before you can comment on or make changes to this bug.