Bug 3906 - /etc/HOSTNAME
/etc/HOSTNAME
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-07-05 21:20 EDT by Marc MERLIN
Modified: 2014-03-16 22:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-07-29 13:11:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marc MERLIN 1999-07-05 21:20:47 EDT
My first issue is this (in /etc/rc.d/rc.sysinit)

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

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 03:28:59 EDT
assigned to notting. We should either keep /etc/HOSTNAME in sync or
get rid of it altogether.
Comment 2 Bill Nottingham 1999-07-29 11:36:59 EDT
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 12:49:59 EDT
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 13:11:59 EDT
Yup, will be in next initscripts release.
Comment 5 Aleksey Nogin 2000-08-07 13:23:10 EDT
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.