summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-03-09 15:53:53 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-09 11:05:15 -0700
commite99f9d3408e44c0ec12488662c9491be7da1f1fe (patch)
tree5e9e7d85772fee78634509518479ef242bc0f926 /xlators/mgmt
parent8612553ffe3d87481c70911a9b8491fb5f4139b5 (diff)
glusterd: don't start gluster-nfs when NFS is disabled
Change-Id: Ic4da2a467a95af7108ed67954f44341131b41c7b BUG: 1199944 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9835 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-nfs-svc.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
index 91cbae7bda6..3caabe34a91 100644
--- a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
+++ b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
@@ -17,6 +17,28 @@
char *nfs_svc_name = "nfs";
+static gf_boolean_t
+glusterd_nfssvc_need_start ()
+{
+ glusterd_conf_t *priv = NULL;
+ gf_boolean_t start = _gf_false;
+ glusterd_volinfo_t *volinfo = NULL;
+
+ priv = THIS->private;
+
+ cds_list_for_each_entry (volinfo, &priv->volumes, vol_list) {
+ if (!glusterd_is_volume_started (volinfo))
+ continue;
+
+ if (dict_get_str_boolean (volinfo->dict, "nfs.disable", 0))
+ continue;
+ start = _gf_true;
+ break;
+ }
+
+ return start;
+}
+
int
glusterd_nfssvc_init (glusterd_svc_t *svc)
{
@@ -142,8 +164,9 @@ glusterd_nfssvc_manager (glusterd_svc_t *svc, void *data, int flags)
{
int ret = -1;
- if (glusterd_are_all_volumes_stopped ()) {
+ if (!glusterd_nfssvc_need_start ()) {
ret = svc->stop (svc, SIGKILL);
+
} else {
ret = glusterd_nfssvc_create_volfile ();
if (ret)
@@ -170,7 +193,10 @@ out:
int
glusterd_nfssvc_start (glusterd_svc_t *svc, int flags)
{
- return glusterd_svc_start (svc, flags, NULL);
+ if (glusterd_nfssvc_need_start ())
+ return glusterd_svc_start (svc, flags, NULL);
+
+ return 0;
}
int