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: Mark . Burgess
Subject: Re: PATCH: resolv.conf edit problem
Date: Sat, 1 Sep 2001 21:06:09 +0200 (MET DST)

On  7 Jun, 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
> 


Adding option in control

EmptyResolvConf = ( true )


in order to give this behaviour.

Mark

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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