From: Chuck Lever Date: Thu, 14 Oct 2010 14:33:25 +0000 (-0400) Subject: mountd: Clear mountd registrations at start up X-Git-Tag: nfs-utils-1-2-4-rc1 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=849b7072a04975bb5da09245fbcacb0cb754a909;p=nfs-utils.git 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 --- 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);