help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: resolv.conf edit problem


From: Elmar Kurgpold
Subject: Re: PATCH: resolv.conf edit problem
Date: Thu, 7 Jun 2001 15:13:06 -0700 (PDT)

This makes more sense to me, but I think it actually works as documented
in the reference guide:

"Note that the resolve action does not delete anything from the file
/etc/resolv.conf. It adds nameservers which do not previously exist and
reorders the lines of servers which do exist."

Maybe this should be an option?

        ++Elmar

On Thu, 7 Jun 2001, Alan Sparks wrote:

> Went to do some resolver config editing.  Put in a rulebase like:
> 
> resolve:
>   208_169_17::
>       208.169.17.163
>       209.119.36.3
> 
> Was surprised to see the old "nameserver" entries still in place after
> the run.
> 
> Problem seems that cfengine does not delete old entries from the list it
> creates as the new image, a copy of the existing config.  So nonexisting
> entries get added, but old entries are never dropped.
> 
> I patched cfengine-1.6.3/src/do.c as follows, to recreate the
> nameservers in the filebase list before adding the new ones:
> 
> *** do.c.orig   Thu Jun  7 15:29:23 2001
> --- do.c        Thu Jun  7 15:29:09 2001
> ***************
> *** 2010,2015 ****
> --- 2010,2017 ----
>      }
>  
>   DeleteItemStarting(&filebase,"domain");
> + while (DeleteItemStarting(&filebase,"nameserver "))
> +   ;
>   EditItemsInResolvConf(VRESOLVE,&filebase);
>   sprintf(VBUFF,"domain %s",ToLowerStr(VDOMAIN));
>   PrependItem(&filebase,VBUFF,NULL);
> 
> 
> With this change, cfengine recreates the resolv.conf properly, with only
> the specified nameservers.
> -Alan
> 
> -- 
> Alan Sparks, Sr. UNIX Administrator   address@hidden
> Quris, Inc.                           (720) 836-2058
> 
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-cfengine
> 

|  Elmar Kurgpold
|  Email: address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]