Thanks for the tips! In my experiments with the default bundle so far, it seems to be set up adequately for non-interactive mode - cf-agent was able to install a package without much difficulty.
The one issue I found with the default bundle, is that it called 'dpkg -l' and parsed the entire output for the status of the package. This is quite an intensive operation (all the regex stuff probably) - and it actually bumped my idle server load up from %0.5 to around %1.5. I then changed the bundle so it actually passed the package name to dpkg -l, which results in information about only that package returned. This brought server load down to near-idle again. Cheers On Mon, Nov 1, 2010 at 6:43 PM, <no-re...@cfengine.com> wrote: > Forum: Cfengine Help > Subject: Re: package mgmt with apt > Author: joke > Link to topic: https://cfengine.com/forum/read.php?3,18977,18979#msg-18979 > > There are pitfalls using apt or aptitude with cfengine. You need to make > sure to disable interactive functions of apt-get/aptitude or the install > process will get stuck every time cfengine tries to install or update a > package using apt-get/aptitude. > > First of all make sure to disable the invocation of debconf using > DEBIAN_FRONTENT environment variable. Second make sure to use a locale which > is ASCII compatible. Use LC_ALL=C or an UTF-8 locale. > > body agent control { > environment => { > "DEBIAN_FRONTEND=noninteractive", > "LC_ALL=en_US.utf8" > }; > } > > Since debconf is disabled use may need to preconfigure the debconf > database. This is only necessary if you want to change the default setting > and the package has been installed yet. Consult the debconf manpage how to > do it. > > > Setup the package management commands for apt-get or aptitude (example). > Make sure to add this commandline option to every apt-get/aptitude command > to prevent them from asking what to do if there are any changes to > configuration files. The option is passed down to dpkg (consult the > manpage). You can customize the package commands as needed. Use cfengine to > handle changes to configuration files. > > Add: -o Dpkg::Options::=--force-confold > > package_add_command => "/usr/bin/aptitude -o > Dpkg::Options::=--force-confold --assume-yes install"; > package_remove_command => "/usr/bin/aptitude -o > Dpkg::Options::=--force-confold --assume-yes remove"; > ................... > package_add_command => "/usr/bin/apt-get -o Dpkg::Options::=--force-confold > --assume-yes install"; > ................... > > > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine >
_______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine