LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Root problem (https://www.linuxquestions.org/questions/fedora-35/root-problem-928513/)

spungo 02-09-2012 12:26 PM

Root problem
 
Okay, I just installed Fedora 14 -- when I su to root and copy across a hosts file into /etc, on reboot the file reverts back to the old hosts file -- i.e., I can't seem to make command-line changes to the filesystem as root without those changes being reversed on reboot. Is this a new (and friggin' annoying) 'feature' of Fedora, or do I have some silly security setting all wrong?

Any help greatly appreciated.

acid_kewpie 02-09-2012 12:34 PM

just installed? You do know that fc14 is officially no longer supported now? Things move fast!

spungo 02-09-2012 12:45 PM

Thanks for your prompt reply, however I have been specifically tasked to install this version of Fedora: the question of its suitability is not mine to answer, hence advising me to upgrade is not helpful.

spungo 02-09-2012 01:34 PM

Ok -- problem isolated -- it's only true for the /etc/hosts file. Some stupid process is over-writing the /etc/hosts file with every reboot. This means that one has to manually enter every new host into the GUI -- which can be a big problem if you want to install a large /etc/hosts file on lots of machines -- back in the day one would do it swiftly with a bit of sftp -- now, I have to do it by hand! That's progress, ain't it!

Of all the braindead, lame-ass crap...

repo 02-09-2012 01:58 PM

What is changing to what?
Perhaps networkmanager or some dhcp daemon is making the changes.
try to use
127.0.0.2

Kind regards

spungo 02-09-2012 02:15 PM

This is what happens:

I manually edit /etc/hosts file on the command line (using vi, of course ;) ). Next, I reboot, and lo and behold the file /etc/hosts is not how I edited it -- it has reverted back to what it was BEFORE I edited it. If, however, I use the GUI (Gnome) and manually add new hosts one by one, when I reboot, those changes are preserved. It looks like some process (probably related to the Network Manager, if not the Network Manager itself) is re-writing the /etc/hosts file at boot -- re-writing it using whatever was contained in the GUI-entered list each time. In short, Network Manager (or some other culprit) over-writes the /etc/hosts file every time you reboot. This removes the old file and replaces it with what the GUI programme has in its settings with regards to what hosts there are. That's it.

lithos 02-09-2012 04:25 PM

If your ETH is DHCP enabled then it tends to overwrite /etc/hosts every reboot.
Make it Fixed IP address.

acid_kewpie 02-09-2012 05:02 PM

Quote:

Originally Posted by lithos (Post 4598427)
If your ETH is DHCP enabled then it tends to overwrite /etc/hosts every reboot.
Make it Fixed IP address.

I've never seen this. resolv.conf sure, but not hosts.

lithos 02-10-2012 01:53 AM

Quote:

Originally Posted by acid_kewpie (Post 4598454)
I've never seen this. resolv.conf sure, but not hosts.

You are correct, My BAD, I'm sorry (i was tired)

repo 02-10-2012 02:48 AM

Quote:

Network Manager (or some other culprit) over-writes the /etc/hosts file every time you reboot.
Did you verify the settings from network manager?
Try to use
127.0.0.2 in /etc/hosts
To rule out network manager, you could use wicd.

Kind regards

spungo 02-10-2012 06:39 AM

Thanks for your help, folks. I've found another chap / chapesse whose had the same problem: http://ubuntu.5.n6.nabble.com/How-to...td1652990.html

The solution quoted within is to run 'chattr' on the /etc/hosts file to stop Network Manager from overwriting it. That's a bit brutal, but what are ya gonna do, huh?

acid_kewpie 02-10-2012 07:45 AM

Yeah, chattr is the "obvious" solution but it's so so crude, it's always got to be better to work at finding the root cause.


All times are GMT -5. The time now is 03:04 PM.