]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: Clear mountd registrations at start up nfs-utils-1-2-4-rc1
authorChuck Lever <chuck.lever@oracle.com>
Thu, 14 Oct 2010 14:33:25 +0000 (10:33 -0400)
committerSteve Dickson <steved@redhat.com>
Thu, 14 Oct 2010 14:33:25 +0000 (10:33 -0400)
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 <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mountd/mountd.c

index d3099506d5c97e50e6bafba718123806e0f39e2a..035624c447ccfa68355332802eecdb6eb4069c61 100644 (file)
@@ -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);