From df6d34d0042421bb87f30bcf5e03d4ba0de7501c Mon Sep 17 00:00:00 2001 From: Pranith K Date: Fri, 17 Dec 2010 02:53:15 +0000 Subject: glusterd: de-register nfs rpcs when it is stopped Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati 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 --- xlators/mgmt/glusterd/src/glusterd-utils.c | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c') 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 #include #include +#include #ifdef GF_SOLARIS_HOST_OS #include #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 -- cgit