[Linux-ha-dev] [PATCH] Fix the return status of monitoring "unblock" action in portblock RA

Dejan Muhamedagic dejanmm at fastmail.fm
Mon Jan 4 05:59:49 MST 2010


Hi,

On Thu, Dec 31, 2009 at 02:45:15PM +0800, Jiaju Zhang wrote:
> Hi list,
> 
> This patch fixes the incorrect return status of "unblock" action in
> the monitor operation in portblock RA.
> Let's see the following use case:
> 
>     Service Group Starting:
>         portblock_block start
>             services start   __timing_1__
>         portblock_unblock start
> 
>                              __timing_2__
> 
>     Service Group Stopping:
>         portblock_unblock stop
>             services stop    __timing_3__    
>         portblock_block stop
>                              __timing_4__
> 
> This is a typical using scenario for portblock RA. In the __timing_4__
> stage, portblock_unblock resource should be considered as stopped, so
> the return status of monitoring should be $OCF_NOT_RUNNING but not
> $OCF_SUCCESS.

Applied. Many thanks for the patch.

Dejan

> Thanks,
> Jiaju
> 
> ---
> diff --git a/heartbeat/portblock b/heartbeat/portblock
> --- a/heartbeat/portblock
> +++ b/heartbeat/portblock
> @@ -194,9 +194,14 @@ IptablesStatus() {
>  		fi
>  		;;
>  	    
> -	    *)	
> -		SayActive $*
> -		rc=$OCF_SUCCESS
> +	    *)
> +		if ha_pseudo_resource "${OCF_RESOURCE_INSTANCE}" status; then	
> +			SayActive $*
> +			rc=$OCF_SUCCESS
> +		else
> +			SayInactive $*
> +			rc=$OCF_NOT_RUNNING
> +		fi
>  		;;
>  	esac
>      fi      
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/


More information about the Linux-HA-Dev mailing list