help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting $(allclasses) into a shellcommand


From: Ted Zlatanov
Subject: Re: Getting $(allclasses) into a shellcommand
Date: 20 Jul 2004 15:52:16 -0400
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

On Tue, 20 Jul 2004, borwicjh@wfu.edu wrote:

Mark.Burgess@iu.hio.no wrote:
>> I am interested in finding a different solution to this problem.
>> Any ideas would be welcome.
>> M
> 
> Could you add a new option to shellcommands that sends all the class
> variables to STDIN?  E.g.
> 
> shellcommands:
>    "/path/to/program" stdin=allclasses

I'm divided about this proposal.  On the one hand, it's elegant and
very much in the Unix spirit.  On the other, it means cfengine can't
use STDOUT for any other communications with the client program.

I propose the following:

1) providing a "classoutput" option which can be "stdout," "file," or
   nil (the default).  With "stdout" the above happens.  With "file"
   the user can expect the name of the file in the CFCLASSOUTPUT
   environment variable; the file contents will be as in (2).

2) Some communication protocol between cfengine and programs it
   spawns.  This should be synchronous, so the cfengine feed to the
   child could be:

CFALLCLASSES=a
CFALLCLASSES=b
CFALLCLASSES=c
CFALLCLASSES=d
...

CFSECTION=shellcommands
CFPID=$$
CFINSTALLABLECLASSES=a
CFINSTALLABLECLASSES=b
CFINSTALLABLECLASSES=c
...

The advantage of the format above is that it's pretty much standard
Unix lingo, so parsing it is trivial for apps like Perl or shells.

We already have the "cfengine-die\n" protocol for communication back
from the spawned program to cfengine :)

Ted




reply via email to

[Prev in Thread] Current Thread [Next in Thread]