On Mon, Dec 20, 2010 at 09:24:22PM +0530, Balbir Singh wrote:
> * torbenh <torb...@gmx.de> [2010-12-19 13:35:03]:
> 
> > > > 
> > > >  # support multiple mount points
> > > >  declare -a MOUNTPOINT
> > > > @@ -120,13 +121,24 @@ start() {
> > > >                      return 6
> > > >                  fi
> > > > 
> > > > -                $CGCONFIGPARSER_BIN -l $CONFIG_FILE
> > > > -                retval=$?
> > > > -                if [ $retval -ne 0 ]
> > > > -                then
> > > > -                    log_failure_msg "Failed to parse " $CONFIG_FILE
> > > > -                    return 1
> > > > -                fi
> > > > +               if [ -d $CONFIG_DIR ]
> > > > +               then
> > > > +                       cat $CONFIG_FILE $CONFIG_DIR/* | 
> > > > $CGCONFIGPARSER_BIN -l -
> > > 
> > > If configuration parsing fails for a particular file, it would get
> > > confusing, since the parser will report the error as being a stdin
> > > error. Why can't we loop through the files and explictly invoke
> > > cgconfigparser?
> > 
> > this would be the better solution.
> > i just had problems with cgconfigparser being invoked multiple times
> > with small snippets of the config.
> >
> 
> True, but I would treat it as a one time cost, unloading is directly
> from the filesystem, so that should still be fast.

no... i was not talking about speed.

if you run cgconfigparser on a file which only has a group defined, i
got:
"Cannot have mount and namespace keyword in the same configuration file"
maybe this is just a bug. 
i dont really understand why this doesnt work.
maybe its just a bug.

>  
> > basically the small snippets which would get dumped into the config dir
> > dont have the mount lines. (so this approach sort of failed)
> > 
> 
> Why did it fail?

see above... checking whether its just a bug...

> 
> > this patch is just an RFC patch, to just show what i am after ;)
> > 
> > if we cant get multiple invocations of cgconfigparser to work,
> > maybe just providing the configfiles to be read on the commandline would
> > also work ?
> > 
> > cgconfigparser $CONFIG_DIR/*
> 
> Or
>         for file in $CONFIG_DIR/*
>         do
>                 cgconfigparser -l $file
>         done
> 
> > 
> > 
> > > 
> > > > +                       retval = $?
> > > > +                       if [ $retval -ne 0 ]
> > > > +                       then
> > > > +                           log_failure_msg "Failed to parse " 
> > > > $CONFIG_FILE " and " $CONFIG_DIR
> > > > +                           return 1
> > > > +                       fi
> > > > +               else
>                 ^^^ else here
> > > 
> > > But why does this have to be else, can't we have both?
> > 
> > it also catted $CONFIG_FILE ... its not else :)
> 
> Oh! did I misread it, I saw an else (see above)

sure... there is an else...

but its...

// assume exists(A)

if exists(B):
   use A, B
else:
   use A


> 
> > 
> > cat $CONFIG_FILE $CONFIG_DIR/* | $CGCONFIGPARSER_BIN -l -

use A, B 

> > > 
> > > > +                       $CGCONFIGPARSER_BIN -l $CONFIG_FILE

use A 


-- 
torben Hohn

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to