[CentOS] More on Re: Really changing the hostname

Fri Feb 15 19:53:24 UTC 2013
Robert Moskowitz <rgm at htt-consult.com>

On 02/15/2013 02:34 PM, m.roth at 5-cent.us wrote:
> Robert Moskowitz wrote:
>> I goofed again after a rebuild from a kickstart so had to rename yet
>> again, see below:
>>
>> On 02/14/2013 01:13 PM, Digimer wrote:
>>> On 02/14/2013 01:11 PM, Robert Moskowitz wrote:
>>>> I need to change the host name on a test server, and in the past when I
>>>> used hostname to change the hostname, it did not seem to change it
>>>> everywhere.
> <snip>
>>>> What is the recommened practice?  Other than get it right the first
>>>> time.
>>> To make the change permanent, edit /etc/ssyconfig/network and set the
>>> desired hostname after HOSTNAME=.
>> I did this and rebooted, but /etc/sysconfig/network-scripts/ifcfg-eth0
>> was not changed. NetworkManager does not seem to have a dialog for
>> changing it there.  I manually edited the file.  When I saved the file,
>> NM seems to have noticed the change and auto-restarted the interface.
>>
> Is this a laptop? If it's a server, or a workstation, the opinion around
> here is NetworkManager MUST DIE.... If you're hardwired, you don't need
> it, ever - network is still there, and doesn't screw around with your
> settings.
>
> Here's another question: you're building it via kickstart - are you
> getting the hostname via dhcp?

Nope.  Hostname in in my network statement.  And I was getting it wrong, 
that is why I had to change it after the build!

> We've got a perl script to create a ks file dynamically, depending on what
> option we want (server, desktop, etc), and we get the name via dhcp, and
> put that in.

The first build for a box is interactive but using netinst and my local 
repos.  Then I alter the anaconda-ks.cfg to make a hardware specific ks, 
doing 'standard' edits.  Thing is sometimes I really don't look hard 
enough at that hostname line (part of my dyslexia perhaps).