On 17 Sep 2010, at 10:59 am, Davide Brini wrote:

> Well, if my custom file is in place before the package is installed, could it 
> be overwritten with the default one by the package installation? (I haven't 
> tried to be honest)

That depends, I suspect, on how you invoke your package manager, and what its 
default behaviour is.  For Debian-derived distros, invoking aptitude with the 
following option forces it to preserve existing config files, if they're 
different from the package's own version.

-o Dpkg::Options::="--force-confold"

On Debian systems, I use a script I called "niagi" (non-interactive apt-get 
install), which does this and a few other things to make it work smoothly with 
cfengine 2, but I imagine it would also work with cfengine 3.:

#!/bin/bash

DEBIAN_FRONTEND=noninteractive \
   /usr/bin/aptitude -R -y \
        -o Dpkg::Options::="--force-confdef" \
        -o Dpkg::Options::="--force-confold" \
      install ${*} >/dev/null

The result of this is that aptitude never asks any questions.  If the conf 
files are already present, they are preserved (dpkg will install newer versions 
as conf-file.dpkg-new instead, so you can examine whether any changes might be 
needed to your policy files later), and if the conf file is not present, it 
will simply choose all of the package's defaults (or whatever your debconf 
settings are, although we don't tend to use those because cfengine doesn't 
have, as far as I know, a built-in method for manipulating debconf settings - 
they're somewhat redundant anyway when you're controlling the config files 
directly)

Regards,

Tim

-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to