summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-ganesha.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-ganesha.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-ganesha.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
index 4d2efb924bd..8cd2aa64cb4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
@@ -671,14 +671,19 @@ start_ganesha (char **op_errstr)
}
}
- ret = priv->nfs_svc.stop (&(priv->nfs_svc), SIGKILL);
- if (ret) {
- ret = -1;
- gf_asprintf (op_errstr, "Gluster-NFS service could"
- "not be stopped, exiting.");
- goto out;
+ /* If the nfs svc is not initialized it means that the service is not
+ * running, hence we can skip the process of stopping gluster-nfs
+ * service
+ */
+ if (priv->nfs_svc.inited) {
+ ret = priv->nfs_svc.stop (&(priv->nfs_svc), SIGKILL);
+ if (ret) {
+ ret = -1;
+ gf_asprintf (op_errstr, "Gluster-NFS service could"
+ "not be stopped, exiting.");
+ goto out;
+ }
}
-
if (check_host_list()) {
ret = manage_service ("start");
if (ret)