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 :-)
assigned to notting. We should either keep /etc/HOSTNAME in sync or get rid of it altogether.
Actually, /etc/HOSTNAME is updated by the network initscripts if it's set, and in the latest initscripts will be updated unconditionally at boot.
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
Yup, will be in next initscripts release.
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).