I have created simple test sample which can demonstrate my problem when i try
use file /var/cfengine/state/allcalases instead variable ${CFALLCLASSES}
Cfagent.conf:
control:
IfElapsed = ( 0 )
actionsequence = ( methods )
methods:
my_method(null)
action=my_method.all
returnvars=null
returnclasses=null
server=localhost
sendclasses=null
my_method.all:
control:
MethodName = ( my_method )
MethodParameters = ( null )
control:
actionsequence = ( shellcommands )
access = ( root )
split = ( '&' )
shellcommands:
"/bin/cp /var/cfengine/state/allclasses /var/cfengine/state/allclasses.dump"
"/bin/echo '${CFALLCLASSES}'>/var/cfengine/state/env.dump"
alerts:
ReturnVariables(void)
ReturnClasses(void)
Run that with command line:
cfagent -D my_own_dynamic_class -f ./cfagent.conf
Then I can found line "my_own_dynamic_class" at file
">/var/cfengine/state/env.dump" but can NOT at file
"/var/cfengine/state/allclasses.dump ".
I only want to know, this is normal or not.
-----Original Message-----
From: Mark Burgess [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 02, 2008 9:40 AM
To: Alexander Shkurko/Шкурко Александр
Cc: [email protected]
Subject: Re: Problem with size of strings
It sounds as though you should be using a module for this task,
whatever it is. The internal cfengine variables are protected from
getting too long.
Alexander Shkurko/Шкурко Александр wrote:
> I try use /var/cfengine/state/allclasses.
>
> It was successful to run my simple parsing script from:
> 1)"classes" section (ReturnsZeroShell)
> 2)"control" section (ExecShellResult)
>
> But it was failed from "shellcommands" section!
> Reason: my manually defined class(cfagent -D myclass) disappeared from file
> /var/cfengine/state/allclasses. Is it normal?
> Note,that my own class - variable,and i can not use "AddInstallable".
>
> -----Original Message-----
> From: Mark Burgess [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 01, 2008 3:07 PM
> To: Alexander Shkurko/Шкурко Александр; bug-cfengine
> Subject: Re: Problem with size of strings
>
>
> This is not a bug. It is described in the manual. It is what the
> /var/cfengine/state/allclasses file is for.
>
> M
>
> Alexander Shkurko/Шкурко Александр wrote:
>> I use in the scripts a variable ${CFALLCLASSES}. But on one of servers
>> one the scripts has failed.
>>
>> The reason:
>>
>> This server has much (> 30) virtual network interfaces. Therefore a
>> variable ${CFALLCLASSES} very long - ~1350 (from debug log, i think
>> this is truncated value...) symbols. I use this variable at
>> “ExecShellResult” and the command line occupies 1436 symbols. But
>> cfengine truncate the length of command line till 1350 symbols so
>> “ExecShellResult” execute wrong command line.
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Bug-cfengine mailing list
>> [email protected]
>> https://cfengine.org/mailman/listinfo/bug-cfengine
>
> --
>
>
> Mark Burgess
>
> Web: http://www.iu.hio.no/~mark
> Tlf: +47 22453272
>
> _______________________________________________
> Bug-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/bug-cfengine
--
Mark Burgess
Web: http://www.iu.hio.no/~mark
Tlf: +47 22453272
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine