Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#299039 - 07/06/2007 14:57 RedHat /etc/hosts problem
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I have about a hundred RedHat machines (RHEL4). I need to change /etc/hosts on each of them. However, I've found that after I change them manually, sometimes they forget the changes and revert to the old file. I'm not sure, but it looks like it's being overwritten on boot by the contents of /etc/sysconfig/networking/profiles/default/hosts, which is apparently normally accessed through the system-config-network programs. But sometimes when I edit /etc/hosts, that file is automatically updated.

What I'd like to know is how to make sure that that file gets updated, and, preferably, how it sometimes gets updated automatically. I'm sure that if I use the system-config-network GUI it'll get updated properly, but I don't really relish the hours that it will take to click through all hundred or so machines, when a script would take me about five minutes to write and five minutes to run, if that. I might be able to use the system-config-network-cmd app to export, modify, then import the, for lack of a better word, registry, but I've done that before with other things and I find that it often causes RedHat to think that its hardware has changed on reboot, which is irritating at the least, so I'd rather avoid that, if possible.

Also, just to let you know: I really f'n hate RedHat.
_________________________
Bitt Faulk

Top
#299040 - 07/06/2007 16:33 Re: RedHat /etc/hosts problem [Re: wfaulk]
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
Any reason to not have your script modify /etc/sysconfig/networking/profiles/default/hosts and /etc/hosts?

Matthew

Top
#299041 - 07/06/2007 16:35 Re: RedHat /etc/hosts problem [Re: matthew_k]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I have no idea if modifying /etc/sysconfig/.../hosts will break anything.
_________________________
Bitt Faulk

Top
#299042 - 07/06/2007 16:54 Re: RedHat /etc/hosts problem [Re: wfaulk]
JBjorgen
carpal tunnel

Registered: 19/01/2002
Posts: 3584
Loc: Columbus, OH
run

# redhat-config-network-cmd --help
then
# redhat-config-network-cmd -o -e | more
to view the current profile.

You should be able to figure out how to import a new profile from there. I don't have a box I can play with at present.
_________________________
~ John

Top
#299043 - 07/06/2007 17:15 Re: RedHat /etc/hosts problem [Re: JBjorgen]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Yeah, I know how to do that, but, like I said, it seems that when I do that, RedHat decides I have new hardware on reboot and tries to go through their stupid "you've got new hardware" wizard thing. I'd like to avoid that if possible.
_________________________
Bitt Faulk

Top
#299044 - 07/06/2007 19:18 Re: RedHat /etc/hosts problem [Re: wfaulk]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Quote:
Yeah, I know how to do that, but, like I said, it seems that when I do that, RedHat decides I have new hardware on reboot and tries to go through their stupid "you've got new hardware" wizard thing. I'd like to avoid that if possible.

I disable Kudzu after its done the initial install.

Top