On Tue, Dec 8, 2009 at 7:04 PM, Jan Safranek <[email protected]> wrote:
> Move sysdefault handling to separate function - it simplifies following
> patch.
>

Makes sense. Will ACK after a closer review in the morning.

> Signed-off-by: Jan Safranek <[email protected]>
> ---
>
>  scripts/init.d/cgconfig.in |   44 
> ++++++++++++++++++++++++--------------------
>  1 files changed, 24 insertions(+), 20 deletions(-)
>
> diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in
> index 543cb9f..13c16f8 100644
> --- a/scripts/init.d/cgconfig.in
> +++ b/scripts/init.d/cgconfig.in
> @@ -70,25 +70,7 @@ umount_fs() {
>         done
>  }
>
> -start() {
> -        echo -n "Starting cgconfig service: "
> -       if [ -f /var/lock/subsys/$servicename ]
> -        then
> -            log_warning_msg "lock file already exists"
> -            return
> -        fi
> -
> -        if [ $? -eq 0 ]
> -        then
> -                $CGCONFIGPARSER_BIN -l $CONFIG_FILE
> -                retval=$?
> -                if [ $retval -ne 0 ]
> -                then
> -                    log_failure_msg "Failed to parse " $CONFIG_FILE
> -                    return $retval
> -                fi
> -        fi
> -
> +create_default_groups() {
>         declare defaultcgroup
>
>         if [ -f /etc/cgrules.conf ]
> @@ -137,7 +119,29 @@ start() {
>                 echo $j > ${MOUNTPOINT[$i]}/$defaultcgroup/tasks 2>/dev/null
>             done
>         done
> -
> +}
> +
> +start() {
> +        echo -n "Starting cgconfig service: "
> +       if [ -f /var/lock/subsys/$servicename ]
> +        then
> +            log_warning_msg "lock file already exists"
> +            return
> +        fi
> +
> +        if [ $? -eq 0 ]
> +        then
> +                $CGCONFIGPARSER_BIN -l $CONFIG_FILE
> +                retval=$?
> +                if [ $retval -ne 0 ]
> +                then
> +                    log_failure_msg "Failed to parse " $CONFIG_FILE
> +                    return $retval
> +                fi
> +        fi
> +
> +       create_default_groups
> +
>         touch /var/lock/subsys/$servicename
>         retval=$?
>         if [ $retval -ne 0 ]
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Libcg-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>



-- 

Ogden Nash  - "The trouble with a kitten is that when it grows up,
it's always a cat." -
http://www.brainyquote.com/quotes/authors/o/ogden_nash.html

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to