Re: passing environment variable to cfengine daemons

Xander Cage <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
restarting all cfengine processe made the thing rolling...

i added this to def.cf:

  aix::
      "environment_vars"
        handle => "common_def_vars_environment_vars",
        comment => "Environment variables of the agent process. The values
                    of environment variables are inherited by child 
commands.
                    This variable makes aix more unix conform, should not 
hurt
                    in cfengine context",
        slist => {
                   "XPG_SUS_ENV=ON",
                 };

 this to cf_agent.cf:

  # Environment variables based on Distro


    debian|aix::

      environment => { @(def.environment_vars) };

  shall i do an PR?
On Tuesday, February 15, 2022 at 9:48:49 AM UTC+1 Xander Cage wrote:

> i tried it it in agent control...also no effect...
>
> Variable name                            Variable value                   
>                             Meta tags                               
>  Comment       
> default:control_agent.environment         {"XPG_SUS_ENV=ON"}               
>                            source=promise                                   
>       
>
> On Tuesday, February 15, 2022 at 9:39:29 AM UTC+1 Xander Cage wrote:
>
>> setting this in my local def.cf seems to not have any effects...
>>
>> root@aixstp19prdbc2: /var/cfengine # /var/cfengine/bin/cf-agent -KI 
>> --show-evaluated-vars=environment
>> ...
>> Variable name                            Variable value                   
>>                             Meta tags                               
>>  Comment       
>> default:def.environment                   {"XPG_SUS_ENV=ON"}             
>>                              source=promise                           aix 
>> is not unix horseshit
>> default:stdlib_common.input[guest_environments] /var/cfengine/inputs/lib/
>> guest_environments.cf               source=promise                       
>>     
>>
>> On Tuesday, February 15, 2022 at 9:11:59 AM UTC+1 Xander Cage wrote:
>>
>>> ashes on my head, but i never heard of that *gg*
>>> can this be set in def.json because..
>>>
>>>   notice: Q: ".../cf-agent" -f /":    error: Command related to promiser 
>>> '"/var/cfengine/bin/cf-execd"' returned code '1' defined as promise failed
>>> Q: ".../cf-agent" -f /":   notice: Q: ".../cf-execd"": 
>>> /var/cfengine/inputs/ITSVlib/itsv_reporting.cf:1:0: error: Duplicate 
>>> definition of body control with type agent
>>>
>>> and i want to avoid modifying MPF
>>>
>>>
>>> On Monday, February 14, 2022 at 5:48:30 PM UTC+1 Nick Anderson wrote:
>>>
>>>> Xander Cage <[email protected]> writes: 
>>>>
>>>> hi, 
>>>>>
>>>>> because of this 
>>>>> https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/aixbman/baseadmn/unix95.htm, 
>>>>> i need to pass an environment variable to cf-agent (maybe all the other 
>>>>> daemons) to force aix to spit out iso formattet timestamps in my custom 
>>>>> reporting promises. 
>>>>>
>>>> Hi Chris, 
>>>>
>>>> Did you set environment in body agent control (controls/cf_agent.cf)? 
>>>> Listing 1: Example Policy
>>>>
>>>> body agent control{
>>>>   with_env::
>>>>     environment => { "XPG_SUS_ENV=ON" };}      bundle agent __main__{
>>>>   reports:
>>>>       "ENV XPG_SUS_ENV='$(with)'" with => getenv( "XPG_SUS_ENV", inf );}
>>>>
>>>>
>>>> # cf-agent --no-lock --log-level info --file /tmp/cf-agent-environment-vars.cf
>>>> R: ENV XPG_SUS_ENV=''
>>>>
>>>>
>>>> # cf-agent --define with_env --no-lock --log-level info --file /tmp/cf-agent-environment-vars.cf
>>>> R: ENV XPG_SUS_ENV='ON'
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/cef573fb-d214-4ab0-a940-ef7b0ab38babn%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.