network manager has gone crazy
Tony Molloy
tony.molloy at ul.ie
Tue Nov 13 07:53:06 UTC 2012
On Tuesday 13 November 2012 05:59:03 Zind wrote:
> On Mon, Nov 12, 2012 at 11:43:54AM +0000, Tony Molloy wrote:
> > On Saturday 10 November 2012 16:05:49 lee wrote:
> >
> > A kludge to fix this is to make resolv.conf immutable. Then
> > NetworkManager or nothing else can interfere with it.
> >
> > Set up /etc/resolv.conf as you want it.
> >
> > Then as root:
> > chattr -i /etc/resolv.conf
> >
> > Now nothing can change /etc/resolv.conf
> >
> > If you need to edit it later then as root:
> > chattr +i /etc/resolv.conf
> >
> > A kludge but it works ;-)
>
> Well, are you sure?
> $man chattr
> A file with the `i' attribute cannot be modified: it cannot be
> deleted or renamed, no link can be created to this file and no
> data can be written to the file. Only the superuser or a process
> possessing the CAP_LINUX_IMMUTABLE capability can set or clear
> this attribute.
>
> So,
> chattr +i /etc/resolv.conf, set /etc/resolv.conf immutable
> chattr -i /etc/resolv.conf, set /etc/resolv.conf mutable
>
You're right, typing before thinking ;-)
chattr +i makes file immutable
chattr -i removes this property.
Tony
More information about the users
mailing list