|
|
c608c9 |
From dab933121dfff2b4e9c141c141a196ddc40e9d56 Mon Sep 17 00:00:00 2001
|
|
|
c608c9 |
From: David Vossel <dvossel@redhat.com>
|
|
|
c608c9 |
Date: Fri, 1 Aug 2014 13:21:11 -0400
|
|
|
c608c9 |
Subject: [PATCH] High: nfsserver: support exit string in nfsserver agent
|
|
|
c608c9 |
|
|
|
c608c9 |
---
|
|
|
c608c9 |
heartbeat/nfsserver | 20 ++++++++++----------
|
|
|
c608c9 |
1 file changed, 10 insertions(+), 10 deletions(-)
|
|
|
c608c9 |
|
|
|
c608c9 |
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
|
|
|
c608c9 |
index ac921f3..de1a802 100755
|
|
|
c608c9 |
--- a/heartbeat/nfsserver
|
|
|
c608c9 |
+++ b/heartbeat/nfsserver
|
|
|
c608c9 |
@@ -317,7 +317,7 @@ set_exec_mode()
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
|
|
|
c608c9 |
- ocf_log err "No init script or systemd unit file detected for nfs server"
|
|
|
c608c9 |
+ ocf_exit_reason "No init script or systemd unit file detected for nfs server"
|
|
|
c608c9 |
exit $OCF_ERR_INSTALLED
|
|
|
c608c9 |
}
|
|
|
c608c9 |
|
|
|
c608c9 |
@@ -366,7 +366,7 @@ nfsserver_monitor ()
|
|
|
c608c9 |
v3locking_exec "status"
|
|
|
c608c9 |
rc=$?
|
|
|
c608c9 |
if [ $rc -ne 0 ]; then
|
|
|
c608c9 |
- ocf_log error "NFS server is up, but the locking daemons are down"
|
|
|
c608c9 |
+ ocf_exit_reason "NFS server is up, but the locking daemons are down"
|
|
|
c608c9 |
rc=$OCF_ERR_GENERIC
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
return $rc
|
|
|
c608c9 |
@@ -682,7 +682,7 @@ nfsserver_start ()
|
|
|
c608c9 |
v3locking_exec "start"
|
|
|
c608c9 |
rc=$?
|
|
|
c608c9 |
if [ $rc -ne 0 ]; then
|
|
|
c608c9 |
- ocf_log error "Failed to start NFS server locking daemons"
|
|
|
c608c9 |
+ ocf_exit_reason "Failed to start NFS server locking daemons"
|
|
|
c608c9 |
return $rc
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
else
|
|
|
c608c9 |
@@ -696,7 +696,7 @@ nfsserver_start ()
|
|
|
c608c9 |
rm -f $fn
|
|
|
c608c9 |
|
|
|
c608c9 |
if [ $rc -ne 0 ]; then
|
|
|
c608c9 |
- ocf_log err "Failed to start NFS server"
|
|
|
c608c9 |
+ ocf_exit_reason "Failed to start NFS server"
|
|
|
c608c9 |
return $rc
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
|
|
|
c608c9 |
@@ -723,16 +723,16 @@ nfsserver_stop ()
|
|
|
c608c9 |
|
|
|
c608c9 |
v3locking_exec "stop"
|
|
|
c608c9 |
if [ $? -ne 0 ]; then
|
|
|
c608c9 |
- ocf_log err "Failed to stop NFS locking daemons"
|
|
|
c608c9 |
+ ocf_exit_reason "Failed to stop NFS locking daemons"
|
|
|
c608c9 |
rc=$OCF_ERR_GENERIC
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
|
|
|
c608c9 |
if [ $rc -eq 0 ]; then
|
|
|
c608c9 |
unbind_tree
|
|
|
c608c9 |
ocf_log info "NFS server stopped"
|
|
|
c608c9 |
- return $OCF_SUCCESS
|
|
|
c608c9 |
+ else
|
|
|
c608c9 |
+ ocf_exit_reason "Failed to stop NFS server"
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
- ocf_log err "Failed to stop NFS server"
|
|
|
c608c9 |
return $rc
|
|
|
c608c9 |
}
|
|
|
c608c9 |
|
|
|
c608c9 |
@@ -746,13 +746,13 @@ nfsserver_validate ()
|
|
|
c608c9 |
|
|
|
c608c9 |
|
|
|
c608c9 |
if [ -n "$OCF_RESKEY_CRM_meta_clone" ] && [ -n "$OCF_RESKEY_nfs_shared_infodir" ]; then
|
|
|
c608c9 |
- ocf_log err "This RA does not support clone mode when a shared info directory is in use."
|
|
|
c608c9 |
+ ocf_exit_reason "This RA does not support clone mode when a shared info directory is in use."
|
|
|
c608c9 |
exit $OCF_ERR_CONFIGURED
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
|
|
|
c608c9 |
if [ -n "$OCF_RESKEY_nfs_smnotify_retry_time" ]; then
|
|
|
c608c9 |
if ! ocf_is_decimal "$OCF_RESKEY_nfs_smnotify_retry_time"; then
|
|
|
c608c9 |
- ocf_log err "Invalid nfs_smnotify_retry_time [$OCF_RESKEY_nfs_smnotify_retry_time]"
|
|
|
c608c9 |
+ ocf_exit_reason "Invalid nfs_smnotify_retry_time [$OCF_RESKEY_nfs_smnotify_retry_time]"
|
|
|
c608c9 |
exit $OCF_ERR_CONFIGURED
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
fi
|
|
|
c608c9 |
@@ -760,7 +760,7 @@ nfsserver_validate ()
|
|
|
c608c9 |
case ${OCF_RESKEY_nfs_notify_cmd##*/} in
|
|
|
c608c9 |
sm-notify|rpc.statd) ;;
|
|
|
c608c9 |
*)
|
|
|
c608c9 |
- ocf_log err "Invalid nfs_notify_cmd [$OCF_RESKEY_nfs_notify_cmd]"
|
|
|
c608c9 |
+ ocf_exit_reason "Invalid nfs_notify_cmd [$OCF_RESKEY_nfs_notify_cmd]"
|
|
|
c608c9 |
exit $OCF_ERR_CONFIGURED
|
|
|
c608c9 |
;;
|
|
|
c608c9 |
esac
|
|
|
c608c9 |
--
|
|
|
c608c9 |
1.8.4.2
|
|
|
c608c9 |
|