Discussion Locked

Unable to change system files in /etc

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Using Red Hat 6. When system files in /etc are changed, on the next re-boot they are back to the install values. Ex: /etc/HOSTNAME was changed. Next re-boot it was the install value. Directory permissions: 777
New files are created & saved OK.

9 replies

by rob wolfe

This might be my grogginess this early in the AM but I am going to suggest something blindingly obvious. Doesnt /etc/HOSTNAME get set by the OS when booting? I am not at my linux machine or I could tell ya for sure (i.e. dont shoot me down until about midnight tonight at which point I will either comment more fully or say I was full of crap ). I do have to say that a list of the other files that are behaving similarly might help.

by rob wolfe

/etc/hostname does exist (most times) i have looked for it ;-)

I suspect, and I may be confused again (note the time) that it is a holdover from an older UNIX way of keeping the hostname somewhere standard. Sort of like the fact that it isnt really (always) necessary to have a "hosts" file if you are running NIS+ or some other wonderful toy.

by landlord

It is just like that.
please check /etc/rc.d/rc.sysinit
the system will set hostname read from /etc/sysconfig/network
everytime it boots.
but i wonder the /etc/HOSTNAME exists?
or somebody else changed the bootup files such as: /etc/rc.d/rc.local /etc/rc.d/rc ?

by zbrain75

Several files in the /etc directory are changed by startup script programs such as
"/etc/rc.d/rc.sysinit" and the script programs in /etc/rc.d/init.d/. Certain scripts in this directory are run based on the runlevel the system is changing to.

The /etc/HOSTNAME file is changed in the /etc/rc.d/rc.sysinit script program. The value it is changed to is based on the /etc/sysconfig/network file. Learning about the files in /etc/sysconfig will help you understand how your system is configured.

If you are interested in learning about how your system starts and why it may change certain files you may want to read the material at:
http://ctdp.tripod.com/os/linux/index.html

The "How Linux Works" and "Startup Manual" should be of some help. Section 14 of "How Linux Works" should help you understand system configuration issues.

I hope this helps.

by zbrain75

Note: The /etc/HOSTNAME file exists for backward compatability for older programs.

This discussion is closed to new replies.