Dear Ed,

All I can say is:

THANKS!

I may hack it around a bit but if I do that I will post it back to the
group.

Best Regards,

Brett


-----Original Message-----
From: Ed Brown [mailto:[EMAIL PROTECTED] 
Sent: 14 July 2006 16:20
To: Brett Delle Grazie
Cc: help-cfengine@cfengine.org
Subject: Re: Package installation of RPMs - Too many arguments in
embeddedscript

Back before the 'packages:' action had an install option (~2 years ago),
when it could only define classes, I wrote a simple[-minded?] perl
wrapper that would parse the list of defined classes and hand off to
yum.  I'm still using it because it's been stable, avoids limitations
like this argument length limit, and offers us some additional features,
like the ability to use team-private rpm repos, and to [forcibly] remove
rpms.  FWIW, it's attached, and obviously YMMV, and, it could be much
simplified if you have no need to refer to different repos (use at your
own risk, disclaimer, disclaimer...) Here's how it might be used:

packages:
# Define classes to be interpreted by called function, yw5.
# Prefix these rpm-related classes with 'needs_'
# Use 'needs_<rpmname>' to install from common yum repository # Use
'needs_NOT_<rpmname>' to remove an rpm (always handled first) # Use
'needs_<teamname>_<rpmname>' to specify a team specific yum repository #
Because cfengine class names can't contain some characters, use these
substitutions:
#   hyphen in rpmname should be '__' in class name
#   period in rpmname should be '___' in classname
#   '++' in rpmname should be '____' in classname

  any::
    krb5-libs           elsedefine=needs_krb5__libs
    netdiag             elsedefine=needs_netdiag
    ntp                 elsedefine=needs_ntp

shellcommands:
   rpm::   #(shellcommands.rpm is early in actionsequence)
      "/var/cfengine/modules/yw5 $(AllClasses) $(rpmserver)" 
inform=false ifelapsed=0


-Ed


[EMAIL PROTECTED] wrote:
> Dear Mark,
> 
> It's not a question of how big - someone will always exceed the limit 
> :) It's the technique employed.  I appreciate you are trying to reuse 
> secure code by enforcing an arbitrary limit on popen calls but the 
> list itself is internally constructed and therefore should be 
> considered secure, _possibly_ bypassing this restriction.  I know that

> buffer overruns are a serious problem in secure software and hence I 
> understand why this limit is in place.
> 
> I'll probably get around it by dumping an iterated list to a temporary

> file that is constructed on the fly and parsing that to a yum/RPM 
> command.  Convoluted but it's questionable whether I should be using 
> cfengine for this task anyway.
> Another option is to use package groups instead but that requires 
> changes in my yum/yam repository.
> 
> I could easily get around it by recompiling with a 'large enough'
> CF_MAXARGUMENTS
> but that would likely have other implications (memory and stack usage 
> primarily).
> So I would prefer not to do that unless absolutely necessary.
> 
> I was hoping that someone had come across this before but obviously
not.
> I'll keep you posted.
> 
> Thanks for your help.
> 
> Best Regards,
> 
> Brett
> 
> -----Original Message-----
> From: Mark Burgess [mailto:[EMAIL PROTECTED]
> Sent: 14 July 2006 11:58
> To: Brett Delle Grazie
> Cc: help-cfengine@cfengine.org
> Subject: Re: Package installation of RPMs - Too many arguments in 
> embedded script
> 
> [EMAIL PROTECTED] wrote:
>> Dear Steve,
>>
>> Thanks for that.  It does appear that it's cfengine imposing the 
>> limit
> 
>> way before it gets anywhere near yum. Looking at the source the issue

>> is in popen.c where it imposes the limit of CF_MAXSHELLARGS (which is

>> set to 30).  I can see why this is done (to limit memory/stack usage)

>> but it does break the package
>>
>> mechanism rather thoroughly.
>>
>> Best Regards,
>>
>> Brett
>>
>> -----Original Message-----
>> From: Steve Kemp [mailto:[EMAIL PROTECTED]
>> Sent: 14 July 2006 11:18
>> To: Brett Delle Grazie
>> Cc: help-cfengine@cfengine.org
>> Subject: Re: Package installation of RPMs - Too many arguments in 
>> embedded script
>>
>> On Fri, Jul 14, 2006 at 10:56:40AM +0100, 
>> [EMAIL PROTECTED] wrote:
>>
>>>    I'm using Yum so my rpm install command is:
>>>     
>>>    RPMInstallCommand = ( "/usr/bin/yum -y install %s" )
>>>     
>>>    However I'm getting the messages (in verbose mode):
>>>    ... long list of packages ...
>>>    package install: cfengine:build-test: Too many arguments in
>> embedded
>>>    script
>>>    Does anyone have a work around for this already (i.e. probably
>> using
>>>    shellcommands)?
>>   Perhaps something like:
>>
>>     /bin/echo %s | xargs --max-args 20 /usr/bin/yum -y install \{\} 
>> \;
>>
>>   That would split up the package installation to only attempt 20 at 
>> a time.  Of course then you might have dependency problems if the 
>> first 20 packages depend on something to be installed in the next  20
> ..
>> Steve
> 
> 
> How big do you think this arg list should be to help you out?
> 
> --
> Mark Burgess
> 
> Professor of Network and System Administration Oslo University College
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272            Email:  [EMAIL PROTECTED]
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> http://cfengine.org/mailman/listinfo/help-cfengine


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
http://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to