General discussion

Locked

Unable to change system files in /etc

By john ·
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.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Unable to change system files in /etc

by Rob Wolfe In reply to Unable to change system f ...

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.

Collapse -

Unable to change system files in /etc

by Rob Wolfe In reply to Unable to change system f ...

/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.

Collapse -

Unable to change system files in /etc

by john In reply to Unable to change system f ...

Poster rated this answer

Collapse -

Unable to change system files in /etc

by Landlord In reply to Unable to change system f ...

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 ?

Collapse -

Unable to change system files in /etc

by john In reply to Unable to change system f ...

Poster rated this answer

Collapse -

Unable to change system files in /etc

by zbrain75 In reply to Unable to change system f ...

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.

Collapse -

Unable to change system files in /etc

by zbrain75 In reply to Unable to change system f ...

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

Collapse -

Unable to change system files in /etc

by john In reply to Unable to change system f ...

Poster rated this answer

Collapse -

Unable to change system files in /etc

by john In reply to Unable to change system f ...

This question was closed by the author

Back to Linux Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums