From 849b7072a04975bb5da09245fbcacb0cb754a909 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Thu, 14 Oct 2010 10:33:25 -0400 Subject: [PATCH] mountd: Clear mountd registrations at start up Clear stale MNT registrations before mountd tries to create fresh listeners, to ensure that mountd starts. This is also what statd does. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- utils/mountd/mountd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index d309950..035624c 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -99,12 +99,9 @@ static int version_any(void) static void unregister_services (void) { - if (version2()) { - nfs_svc_unregister(MOUNTPROG, MOUNTVERS); - nfs_svc_unregister(MOUNTPROG, MOUNTVERS_POSIX); - } - if (version3()) - nfs_svc_unregister(MOUNTPROG, MOUNTVERS_NFSV3); + nfs_svc_unregister(MOUNTPROG, MOUNTVERS); + nfs_svc_unregister(MOUNTPROG, MOUNTVERS_POSIX); + nfs_svc_unregister(MOUNTPROG, MOUNTVERS_NFSV3); } static void @@ -840,6 +837,7 @@ main(int argc, char **argv) if (new_cache) cache_open(); + unregister_services(); if (version2()) { listeners += nfs_svc_create("mountd", MOUNTPROG, MOUNTVERS, mount_dispatch, port); -- 2.39.5