On 11/19/2010 09:08 AM, [email protected] wrote:
> Now cgred script can't return proper value. Because
> stop()/start() functions return result of if [] when failing,
> and result of wrong commands when succeeding.
>
> So fix this.
>
> Signed-off-by: Masaki Tachibana<[email protected]>

Acked-By: Jan Safranek <[email protected]>
+ merged and pushed, thanks!

> ---
>   scripts/init.d/cgred.in |   14 ++++++++++----
>   1 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/init.d/cgred.in b/scripts/init.d/cgred.in
> index c05ddf0..b3846a0 100644
> --- a/scripts/init.d/cgred.in
> +++ b/scripts/init.d/cgred.in
> @@ -89,8 +89,12 @@ start()
>       if [ $RETVAL -ne 0 ]; then
>               return 7
>       fi
> -     [ $RETVAL -eq 0 ]&&  touch /var/lock/subsys/$servicename
> +     touch /var/lock/subsys/$servicename
> +     if [ $? -ne 0 ]; then
> +             return 1
> +     fi
>       echo "`pidof $processname`">  $pidfile
> +     return 0
>   }
>
>   stop()
> @@ -103,10 +107,12 @@ stop()
>       killproc -p $pidfile $processname -TERM
>       RETVAL=$?
>       echo
> -     if [ $RETVAL -eq 0 ] ; then
> -             rm -f /var/lock/subsys/$servicename
> -             rm -f $pidfile
> +     if [ $RETVAL -ne 0 ] ; then
> +             return 1
>       fi
> +     rm -f /var/lock/subsys/$servicename
> +     rm -f $pidfile
> +     return 0
>   }
>
>   # See how we are called


------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to