LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 06-07-2007, 03:35 PM   #1
wfaulk
LQ Newbie
 
Registered: Jun 2007
Posts: 2

Rep: Reputation: 0
RHEL4 /etc/hosts problem


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.

Any help or pointers would be appreciated.
 
Old 06-07-2007, 04:01 PM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
The /etc/sysconfig/networking/profiles/default/hosts file is not needed, it is safe to delete. It will get recreated if needed from the /etc/hosts file on reboot or restarting the network service. As a suggestion add both the deleting of all the files in both the /etc/sysconfig/networking/ sub-directories.

$ ls -al /etc/sysconfig/networking/profiles/default
total 16
drwxr-xr-x 2 root root 4096 Apr 27 10:18 .
drwxr-xr-x 3 root root 4096 Mar 30 11:57 ..

$ ls -al /etc/sysconfig/networking/devices
total 16
drwxr-xr-x 2 root root 4096 Apr 27 10:17 .
drwxr-xr-x 4 root root 4096 Mar 30 11:57 ..

You may want to disable kudzu also: chkconfig --levels 345 kudzu off
 
Old 06-07-2007, 04:15 PM   #3
wfaulk
LQ Newbie
 
Registered: Jun 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Lenard
You may want to disable kudzu also: chkconfig --levels 345 kudzu off
Aha! Great! Thanks for that.

Quote:
Originally Posted by Lenard
The /etc/sysconfig/networking/profiles/default/hosts file is not needed, it is safe to delete. It will get recreated if needed from the /etc/hosts file on reboot or restarting the network service. As a suggestion add both the deleting of all the files in both the /etc/sysconfig/networking/ sub-directories.
So I can just delete everything in the devices and profiles directories altogether?
 
Old 06-07-2007, 09:54 PM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
Yes one can delete everything in the two directories.
 
  


Reply

Tags
profile, profiles


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL4 bonding problem sc425000 Linux - Networking 4 07-16-2009 12:59 AM
remote backup from RHEL4 to another RHEL4? dkgoalie Linux - Newbie 2 10-28-2006 12:14 AM
RHEL4 up2date problem gireesha_ks Linux - Enterprise 2 06-15-2006 09:36 AM
RHEL4 problem with memory klith2003 Red Hat 2 02-18-2006 05:42 AM
yum on RHEL4 problem giovannym Linux - Newbie 1 07-11-2005 05:20 PM


All times are GMT -5. The time now is 10:38 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration