Re: [SLUG] hostname won't stick

From: Paul M Foster (paulf@quillandmouse.com)
Date: Tue Oct 22 2002 - 18:16:04 EDT


On Tue, Oct 22, 2002 at 03:27:59PM -0400, Mario Lombardo wrote:

> Supe-dupe! Thanks, guys!
>
> Now some gripe regarding RedHat7.1...
> Why do the man pages of hostname and ypdomainname say they will work,
> yet they don't--only temporarily?
> If hostname and ypdomainname are successfully changing something,
> what are they changing?
> Is there a way to 'trace' this w/o being a programmer?
> How would one know what file is getting sucked in to present the
> hostname at the shell prompt (I looked in .bashrc and .bash_profile;
> nothing)?

It's this way in all distros, probably. Hostname does work, but the
environment variable that holds hostname is set by the OS on boot. In
Red Hat's case, it's the /etc/sysconfig/network file that holds the
value. There's a script somewhere (probably in /etc/init.d) that reads
that file and sets values. You can grep for the value in that directory
and probably find what script sets it. A lot of things (like the gateway
and eth0 settings) are set at boot by each distro in their own way, so
you don't have to run ifconfig, hostname, and all that other crap on
your own. And each distro also has its own way (outside of vi) to access
and change these values. With SuSE, it's YaST/YaST2.

HTH,

Paul



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:33:44 EDT