Re: [Linux-ha-dev] 答复: Re: New patch for resource-agents(nfsserver)

2013-01-23 Thread Dejan Muhamedagic
On Tue, Jan 22, 2013 at 08:21:34PM -0700, John Shi wrote:
 Hi Dejan,
Is this patch OK ?  I didn't see the pache going upstream yet.
Thanks!

Applied now. Can you please also test the attached patch. It is
fairly small and low impact, but still.

Cheers,

Dejan

 Best regards,
 John
 
  Dejan Muhamedagic de...@suse.de 2012-12-24 下午 17:57 
 Hi John,
 
 On Wed, Dec 19, 2012 at 11:18:41PM -0700, John Shi wrote:
  Hi all,
  
  Fix all cause an error to call rpc.statd, including:
  
  Specify the value of nfs_notify_cmd should be either sm-notify or rpc.statd 
  in meta_data.
  Rename the parameter nfs_notify_retry_time to nfs_smnotify_retry_time, 
  bacase no retrytime option for rpc.statd.
  The parameter nfs_notify_foreground can make the correct option for 
  rpc.statd
 
 Looks good to me.
 
 Cheers,
 
 Dejan
 
  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/
 
 ___
 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/
 
 
 

From 186919824523c362d63b4ac176ce91511b91c99d Mon Sep 17 00:00:00 2001
From: Dejan Muhamedagic de...@suse.de
Date: Wed, 23 Jan 2013 17:10:11 +0100
Subject: [PATCH] Low: nfsserver: move configuration checks to the validation
 phase

---
 heartbeat/nfsserver | 23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
index 003fcc6..09136d7 100755
--- a/heartbeat/nfsserver
+++ b/heartbeat/nfsserver
@@ -254,10 +254,6 @@ nfsserver_start ()
 		fi
 
 		if [ -n $OCF_RESKEY_nfs_smnotify_retry_time ]; then
-			if ! ocf_is_decimal $OCF_RESKEY_nfs_smnotify_retry_time; then
-ocf_log err Invalid OCF_RESKEY_nfs_smnotify_retry_time [$OCF_RESKEY_nfs_smnotify_retry_time]
-return $OCF_ERR_CONFIGURED
-			fi
 			opts=$opts -m $OCF_RESKEY_nfs_smnotify_retry_time
 		fi
 
@@ -271,10 +267,6 @@ nfsserver_start ()
 		opts=$opts -n
 		;;
 
-	*)
-		ocf_log err Invalid OCF_RESKEY_nfs_notify_cmd [$OCF_RESKEY_nfs_notify_cmd]
-		return $OCF_ERR_CONFIGURED
-		;;
 	esac
 
 	rm -rf /var/lib/nfs/sm.ha.save  /dev/null 21
@@ -324,6 +316,21 @@ nfsserver_validate ()
 		exit $OCF_ERR_CONFIGURED
 	fi
 
+	if [ -n $OCF_RESKEY_nfs_smnotify_retry_time ]; then
+		if ! ocf_is_decimal $OCF_RESKEY_nfs_smnotify_retry_time; then
+			ocf_log err Invalid nfs_smnotify_retry_time [$OCF_RESKEY_nfs_smnotify_retry_time]
+			exit $OCF_ERR_CONFIGURED
+		fi
+	fi
+
+	case ${OCF_RESKEY_nfs_notify_cmd##*/} in 
+	sm-notify|rpc.statd) ;;
+	*)
+		ocf_log err Invalid nfs_notify_cmd [$OCF_RESKEY_nfs_notify_cmd]
+		exit $OCF_ERR_CONFIGURED
+		;;
+	esac
+
 	return $OCF_SUCCESS
 }
 
-- 
1.8.0

___
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/


[Linux-ha-dev] 答复: Re: New patch for resource-agents(nfsserver)

2013-01-22 Thread John Shi
Hi Dejan,
   Is this patch OK ?  I didn't see the pache going upstream yet.
   Thanks!

Best regards,
John

 Dejan Muhamedagic de...@suse.de 2012-12-24 下午 17:57 
Hi John,

On Wed, Dec 19, 2012 at 11:18:41PM -0700, John Shi wrote:
 Hi all,
 
 Fix all cause an error to call rpc.statd, including:
 
 Specify the value of nfs_notify_cmd should be either sm-notify or rpc.statd 
 in meta_data.
 Rename the parameter nfs_notify_retry_time to nfs_smnotify_retry_time, bacase 
 no retrytime option for rpc.statd.
 The parameter nfs_notify_foreground can make the correct option for rpc.statd

Looks good to me.

Cheers,

Dejan

 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/

___
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/



___
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/


Re: [Linux-ha-dev] 答复: Re: New patch for resource-agents(nfsserver)

2013-01-22 Thread Dejan Muhamedagic
Hi John,

On Tue, Jan 22, 2013 at 08:21:34PM -0700, John Shi wrote:
 Hi Dejan,
Is this patch OK ?  I didn't see the pache going upstream yet.
Thanks!

Oh, yes, I think so. Sorry, I missed it somehow. Will take care
of it today.

Cheers,

Dejan

 Best regards,
 John
 
  Dejan Muhamedagic de...@suse.de 2012-12-24 下午 17:57 
 Hi John,
 
 On Wed, Dec 19, 2012 at 11:18:41PM -0700, John Shi wrote:
  Hi all,
  
  Fix all cause an error to call rpc.statd, including:
  
  Specify the value of nfs_notify_cmd should be either sm-notify or rpc.statd 
  in meta_data.
  Rename the parameter nfs_notify_retry_time to nfs_smnotify_retry_time, 
  bacase no retrytime option for rpc.statd.
  The parameter nfs_notify_foreground can make the correct option for 
  rpc.statd
 
 Looks good to me.
 
 Cheers,
 
 Dejan
 
  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/
 
 ___
 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/
 
 
 

___
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/


[Linux-ha-dev] 答复: Re: A patch for resource-agents(nfsserver)

2012-12-13 Thread John Shi


 Dejan Muhamedagic de...@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

___
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/