Mailing List Archive

转发: 答复: Re: A patch for resource-agents(nfsserver) ( add attachment )
>>> John Shi 2012-12-14 下午 15:20 >>>


>>> Dejan Muhamedagic <dejan@suse.de> 2012-12-13 下午 17:33 >>>

>This might be a bit better:
>
># set default options
>local opts="-f -v"
>
># add option for notify_retry_time, if set
>if [ -n "$OCF_RESKEY_nfs_notify_retry_time" ]; then
> if ! ocf_is_decimal "$OCF_RESKEY_nfs_notify_retry_time"; then
> ocf_log err "Invalid OCF_RESKEY_nfs_notify_retry_time [$OCF_RESKEY_nfs_notify_retry_time]"
> return $OCF_ERR_CONFIGURED
> fi
> opts="$opts -m $OCF_RESKEY_nfs_notify_retry_time"
>fi
>
># run in foreground, if requested
>if ocf_is_true "$OCF_RESKEY_nfs_notify_foreground"; then
> opts="$opts -d"
>fi

>What do you say?

You are right, the default value of retry_time should be "".
A little adjustment, please see the code 229 line of nfsserver:

${OCF_RESKEY_nfs_notify_cmd} $opts $ip -P /var/lib/nfs/sm.ha

$ip is the optarg of -v, so the code may be:

# set default options
local opts="-f -v"

# add option for notify_retry_time, if set
if [ -n "$OCF_RESKEY_nfs_notify_retry_time" ]; then
if ! ocf_is_decimal "$OCF_RESKEY_nfs_notify_retry_time"; then
ocf_log err "Invalid OCF_RESKEY_nfs_notify_retry_time [$OCF_RESKEY_nfs_notify_retry_time]"
return $OCF_ERR_CONFIGURED
fi
opts="-m $OCF_RESKEY_nfs_notify_retry_time $opts"
fi

# run in foreground, if requested
if ocf_is_true "$OCF_RESKEY_nfs_notify_foreground"; then
opts="-d $opts"
fi


Best regards,
John
Re: 转发: 答复: Re: A patch for resource-agents(nfsserver) ( add attachment ) [ In reply to ]
Hi John,

On Fri, Dec 14, 2012 at 12:24:34AM -0700, John Shi wrote:
>
>
> >>> John Shi 2012-12-14 下午 15:20 >>>
>
>
> >>> Dejan Muhamedagic <dejan@suse.de> 2012-12-13 下午 17:33 >>>
>
> >This might be a bit better:
> >
> ># set default options
> >local opts="-f -v"
> >
> ># add option for notify_retry_time, if set
> >if [ -n "$OCF_RESKEY_nfs_notify_retry_time" ]; then
> > if ! ocf_is_decimal "$OCF_RESKEY_nfs_notify_retry_time"; then
> > ocf_log err "Invalid OCF_RESKEY_nfs_notify_retry_time [$OCF_RESKEY_nfs_notify_retry_time]"
> > return $OCF_ERR_CONFIGURED
> > fi
> > opts="$opts -m $OCF_RESKEY_nfs_notify_retry_time"
> >fi
> >
> ># run in foreground, if requested
> >if ocf_is_true "$OCF_RESKEY_nfs_notify_foreground"; then
> > opts="$opts -d"
> >fi
>
> >What do you say?
>
> You are right, the default value of retry_time should be "".
> A little adjustment, please see the code 229 line of nfsserver:
>
> ${OCF_RESKEY_nfs_notify_cmd} $opts $ip -P /var/lib/nfs/sm.ha
>
> $ip is the optarg of -v, so the code may be:

oops, missed that. Well spotted!

Patches applied. Many thanks for the contribution!

Cheers,

Dejan

> # set default options
> local opts="-f -v"
>
> # add option for notify_retry_time, if set
> if [ -n "$OCF_RESKEY_nfs_notify_retry_time" ]; then
> if ! ocf_is_decimal "$OCF_RESKEY_nfs_notify_retry_time"; then
> ocf_log err "Invalid OCF_RESKEY_nfs_notify_retry_time [$OCF_RESKEY_nfs_notify_retry_time]"
> return $OCF_ERR_CONFIGURED
> fi
> opts="-m $OCF_RESKEY_nfs_notify_retry_time $opts"
> fi
>
> # run in foreground, if requested
> if ocf_is_true "$OCF_RESKEY_nfs_notify_foreground"; then
> opts="-d $opts"
> fi
>
>
> Best regards,
> John
>



_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/