On Fri, Dec 17, 2010 at 10:02:07PM +0530, Balbir Singh wrote: > * Torben Hohn <torb...@gmx.de> [2010-12-17 16:30:28]: > > > this allows packages to create cgroups by just dumping files into > > this directory. > > packagers need to look out for naming conflicts themselves, but > > not many packages are going to use this in the near future, so > > this is going to be coordinatable until we can provide a proper solution > > --- > > scripts/init.d/cgconfig.in | 26 +++++++++++++++++++------- > > 1 files changed, 19 insertions(+), 7 deletions(-) > > > > diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in > > index 0b3afd2..993897f 100644 > > --- a/scripts/init.d/cgconfig.in > > +++ b/scripts/init.d/cgconfig.in > > @@ -34,6 +34,7 @@ > > pref...@prefix@;exec_pref...@exec_prefix@;sbind...@sbindir@ > > CGCONFIGPARSER_BIN=$sbindir/cgconfigparser > > CGROUP_FS=cgroup > > CONFIG_FILE=/etc/cgconfig.conf > > +CONFIG_DIR=/etc/cgconfig.conf.d > > > > # 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. basically the small snippets which would get dumped into the config dir dont have the mount lines. (so this approach sort of failed) 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/* > > > + retval = $? > > + if [ $retval -ne 0 ] > > + then > > + log_failure_msg "Failed to parse " $CONFIG_FILE " > > and " $CONFIG_DIR > > + return 1 > > + fi > > + else > > But why does this have to be else, can't we have both? it also catted $CONFIG_FILE ... its not else :) cat $CONFIG_FILE $CONFIG_DIR/* | $CGCONFIGPARSER_BIN -l - > > > + $CGCONFIGPARSER_BIN -l $CONFIG_FILE > > + retval=$? > > + if [ $retval -ne 0 ] > > + then > > + log_failure_msg "Failed to parse " $CONFIG_FILE > > + return 1 > > + fi > > + fi > > fi > > > > if [ $CREATE_DEFAULT == "yes" ]; then > > -- > > 1.7.2.3 > > > > > > ------------------------------------------------------------------------------ > > 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 > > -- > Three Cheers, > Balbir -- 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