How to stop Network Manager (I asssume) overwriting /etc/hosts in 10.10?

Chris G cl at isbd.net
Wed Mar 23 14:09:29 UTC 2011


On Wed, Mar 23, 2011 at 09:58:33AM -0400, Ray Leventhal wrote:
> On 03/22/2011 04:34 PM, Chris G wrote:
> 
> 
> <snip>
> > On Tue, Mar 22, 2011 at 03:36:18PM -0400, Ray Leventhal wrote:
> >>>
> >>
> >>Perhaps issuing the command:
> >>
> >>sudo chattr +i /etc/hosts
> >>
> >>after making your specific edits will keep it from being re/over-written.
> >>
> >>Not tested, just a thought.
> >>
> >I had tried setting /etc/hosts read-only (chmod 0444) and that didn't
> >work, I'm not sure if the above would work better.
> >
> 
> Hi Chris,
> 
> I did test the immutable flag (+i) and it seems to keep anything
> from writing to the file on which it is set.  This may well fix your
> problem.
> 
Thanks.  For the present using wicd instead of NM is doing what I need
but I can use that chattr command as a backstop! :-)

I hadn't come across the file attributes thing before, being a
died-in-the-wool Unix descendent as older real Unix systems don't have
these extra file attributes.

-- 
Chris Green




More information about the ubuntu-users mailing list