Hi Ted, You can set the environment in agent control: http://www.cfengine.org/manuals/cf3-reference.html#environment-in-agent This is a global setting that will be inherited by all children (commands-promises and backgrounded/forked agent jobs). I am not aware of a way to set this on a per-command basis, but this seems useful. Perhaps it belongs in body contain: http://www.cfengine.org/manuals/cf3-reference.html#contain-in-commands
If you can't find it, would you mind making a feature request at http://bug.cfengine.com? It should be trivial to implement (unless there are implications I don't see). -- Regards, Eystein 2011/3/11 Ted Zlatanov <t...@lifelogs.com>: > On Thu, 10 Mar 2011 22:35:31 +0100 (CET) mark wrote: > > n> Please don't embed su in shell commands, use the contain method > > n> contain => setuid("uid") > > n> to do this. As always, if you look carefully, you will find the way to use > the features in a secure and efficient manner. > > Is there a way to simulate "su -" to clear the environment or clear > individual entries? > > Can the environment be set by cfengine (I know I can prepend "X=y" to > the command line but then it has to be escaped and quoted)? Can an > environment entry be incremented (e.g. add "/x/y/bin" to the PATH)? > > I didn't see a way to do any of this in the manual. There's just the > getenv() function. > > Thanks > Ted > _______________________________________________ > 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