Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
The two options are actually independent. So, they should be
either put into two patches or the description modified to
better reflect the change.
---
heartbeat/nfsserver | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
index 6414e3a..974bff9 100755
--- a/heartbeat/nfsserver
+++ b/heartbeat/nfsserver
@@ -14,6 +14,8 @@ fi
DEFAULT_INIT_SCRIPT="/etc/init.d/nfsserver"
DEFAULT_NOTIFY_CMD="/sbin/sm-notify"
+DEFAULT_NOTIFY_FOREGROUND="false"
+DEFAULT_NOTIFY_RETRY_TIME=15
DEFAULT_RPCPIPEFS_DIR="/var/lib/nfs/rpc_pipefs"
nfsserver_meta_data() {
@@ -55,6 +57,28 @@ The tool to send out notification.
<content type="string" default="$DEFAULT_NOTIFY_CMD" />
</parameter>
+<parameter name="nfs_notify_foreground" unique="0" required="0">
+<longdesc lang="en">
+Keeps sm-notify attached to its controlling terminal and running in the foreground.
+</longdesc>
+<shortdesc lang="en">
+Keeps sm-notify running in the foreground.
+</shortdesc>
+<content type="boolean" default="$DEFAULT_NOTIFY_FOREGROUND" />
+</parameter>
+
+<parameter name="nfs_notify_retry_time" unique="0" required="0">
+<longdesc lang="en">
+Specifies the length of sm-notify retry time, in minutes, to continue retrying notifications to unresponsive hosts.
+If this option is not specified, sm-notify attempts to send notifications for 15 minutes. Specifying a value of 0
+causes sm-notify to continue sending notifications to unresponsive peers until it is manually killed.
+</longdesc>
+<shortdesc lang="en">
+Specifies the length of sm-notify retry time(minutes).
+</shortdesc>
+<content type="integer" default="$DEFAULT_NOTIFY_RETRY_TIME" />
+</parameter>
+
<parameter name="nfs_shared_infodir" unique="0" required="1">
<longdesc lang="en">
The nfsserver resource agent will save nfs related information in this specific directory.
@@ -129,6 +153,8 @@ esac
fp="$OCF_RESKEY_nfs_shared_infodir"
: ${OCF_RESKEY_nfs_init_script="$DEFAULT_INIT_SCRIPT"}
: ${OCF_RESKEY_nfs_notify_cmd="$DEFAULT_NOTIFY_CMD"}
+: ${OCF_RESKEY_nfs_notify_foreground="$DEFAULT_NOTIFY_FOREGROUND"}
+: ${OCF_RESKEY_nfs_notify_retry_time="$DEFAULT_NOTIFY_RETRY_TIME"}
if [ -z ${OCF_RESKEY_rpcpipefs_dir} ]; then
rpcpipefs_make_dir=$fp/rpc_pipefs
@@ -220,7 +246,17 @@ nfsserver_start ()
#Notify the nfs server has been moved or rebooted
#The init script do that already, but with the hostname, which may be ignored by client
#we have to do it again with the nfs_ip
- local opts="-f -v"
+ local opts
+
+ 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
+ if ocf_is_true "$OCF_RESKEY_nfs_notify_foreground"; then
+ opts="-d"
+ fi
+ opts="$opts -m $OCF_RESKEY_nfs_notify_retry_time -f -v"
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?

Cheers,

Dejan

Loading...