[Pm-utils] stopservice function doesn't work with gentoo

Pacho Ramos pacho at condmat1.ciencias.uniovi.es
Sun Jan 18 12:23:25 PST 2009


El dom, 18-01-2009 a las 11:43 -0800, Dan Nicholson escribió:
> I believe the patch below should work.
> 
> --
> Dan
> 
> >From df99431ba8ee5a2a5b552f32950ae98eec9757d2 Mon Sep 17 00:00:00 2001
> From: Dan Nicholson <dbn.lists at gmail.com>
> Date: Sun, 18 Jan 2009 11:20:47 -0800
> Subject: [PATCH] Match gentoo message "started" when checking for running services
> 
> Gentoo uses the convention of printing the message "started" when
> showing the status of services. Augment stopservice() to check this in
> addition to "running". This also drops the unnecessary -c argument from
> the grep command.
> 
> Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
> ---
>  pm/functions.in |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/pm/functions.in b/pm/functions.in
> index 70740cb..019e8d2 100644
> --- a/pm/functions.in
> +++ b/pm/functions.in
> @@ -141,7 +141,8 @@ fi
>  
>  stopservice()
>  {
> -	if service "$1" status 2>/dev/null | grep -c -q running; then
> +	if service "$1" status 2>/dev/null | grep -q -e running -e started
> +	then
>  		touch "${STORAGEDIR}/service:$1"
>  		service "$1" stop
>  	fi

Yes, it works :-D

Oh, silly me! simply "-e" can do it 

Thanks a lot and sorry for the inconvenience

Will this be merged to trunk? 



More information about the Pm-utils mailing list