diff options
-rw-r--r-- | extras/ganesha/scripts/ganesha-ha.sh | 6 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-ganesha.c | 25 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-messages.h | 10 |
3 files changed, 27 insertions, 14 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh index d0e666f611c..c2b6f6c8895 100644 --- a/extras/ganesha/scripts/ganesha-ha.sh +++ b/extras/ganesha/scripts/ganesha-ha.sh @@ -277,8 +277,7 @@ string:\"EXPORT(Export_Id=$removed_id)\" 2>&1") ret=$? logger <<< "${output}" if [ ${ret} -ne 0 ]; then - echo "Error: refresh-config failed on ${current_host}." - exit 1 + echo "Refresh-config failed on ${current_host}" else echo "Refresh-config completed on ${current_host}." fi @@ -299,8 +298,7 @@ string:"EXPORT(Export_Id=$removed_id)" 2>&1) ret=$? logger <<< "${output}" if [ ${ret} -ne 0 ] ; then - echo "Error: refresh-config failed on localhost." - exit 1 + echo "Refresh-config failed on localhost." else echo "Success: refresh-config completed." fi diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c index 0348f7c280b..64c3d0f6c80 100644 --- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c +++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c @@ -554,15 +554,22 @@ ganesha_manage_export (dict_t *dict, char *value, char **op_errstr) } if (check_host_list()) { - runner_add_args (&runner, - GANESHA_PREFIX"/dbus-send.sh", - CONFDIR, value, volname, NULL); - ret = runner_run (&runner); - if (ret) { - gf_asprintf(op_errstr, "Dynamic export" - " addition/deletion failed." - " Please see log file for details"); - goto out; + /* Check whether ganesha is running on this node */ + if (manage_service ("status")) { + gf_msg (this->name, GF_LOG_WARNING, 0, + GD_MSG_GANESHA_NOT_RUNNING, + "Export failed, NFS-Ganesha is not running"); + } else { + runner_add_args (&runner, + GANESHA_PREFIX"/dbus-send.sh", + CONFDIR, value, volname, NULL); + ret = runner_run (&runner); + if (ret) { + gf_asprintf(op_errstr, "Dynamic export" + " addition/deletion failed." + " Please see log file for details"); + goto out; + } } } diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h index 28c73d23d82..b41d91f4ca9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-messages.h +++ b/xlators/mgmt/glusterd/src/glusterd-messages.h @@ -4834,7 +4834,15 @@ * */ -#define GD_MSG_NO_SIG_TO_PID_ZERO (GLUSTERD_COMP_BASE + 597) +#define GD_MSG_GANESHA_NOT_RUNNING (GLUSTERD_COMP_BASE + 597) +/*! + * @messageid + * @diagnosis + * @recommendedaction + * + */ + +#define GD_MSG_NO_SIG_TO_PID_ZERO (GLUSTERD_COMP_BASE + 598) /*------------*/ |