summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2010-12-17 02:53:15 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-01-24 14:19:37 -0800
commitdf6d34d0042421bb87f30bcf5e03d4ba0de7501c (patch)
tree4654ea8103e17c1c99f61bf535224ea1cb900e53 /xlators/mgmt/glusterd/src/glusterd-utils.c
parentf2a067c4fe92f7aefc5f64ea1e5b000c16af0946 (diff)
glusterd: de-register nfs rpcs when it is stopped
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1783 (kill glusterd and stop the cluster and start again - check nfs process) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1783
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 1794348f270..db0b0b385c5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -51,11 +51,18 @@
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <rpc/pmap_clnt.h>
#ifdef GF_SOLARIS_HOST_OS
#include <sys/sockio.h>
#endif
+#define MOUNT_PROGRAM 100005
+#define NFS_PROGRAM 100003
+#define NFSV3_VERSION 3
+#define MOUNTV3_VERSION 3
+#define MOUNTV1_VERSION 1
+
static glusterd_lock_t lock;
static int32_t
@@ -1760,6 +1767,26 @@ out:
return ret;
}
+void
+glusterd_nfs_pmap_deregister ()
+{
+ if (pmap_unset (MOUNT_PROGRAM, MOUNTV3_VERSION))
+ gf_log ("", GF_LOG_NORMAL, "De-registered MOUNTV3 successfully");
+ else
+ gf_log ("", GF_LOG_ERROR, "De-register MOUNTV3 is unsuccessful");
+
+ if (pmap_unset (MOUNT_PROGRAM, MOUNTV1_VERSION))
+ gf_log ("", GF_LOG_NORMAL, "De-registered MOUNTV1 successfully");
+ else
+ gf_log ("", GF_LOG_ERROR, "De-register MOUNTV1 is unsuccessful");
+
+ if (pmap_unset (NFS_PROGRAM, NFSV3_VERSION))
+ gf_log ("", GF_LOG_NORMAL, "De-registered NFSV3 successfully");
+ else
+ gf_log ("", GF_LOG_ERROR, "De-register NFSV3 is unsuccessful");
+
+}
+
int32_t
glusterd_nfs_server_stop ()
{
@@ -1776,7 +1803,10 @@ glusterd_nfs_server_stop ()
GLUSTERD_GET_NFS_DIR(path, priv);
GLUSTERD_GET_NFS_PIDFILE(pidfile);
- return glusterd_service_stop ("nfsd", pidfile, SIGKILL, _gf_true);
+ glusterd_service_stop ("nfsd", pidfile, SIGKILL, _gf_true);
+ glusterd_nfs_pmap_deregister ();
+
+ return 0;
}
int