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 d309950..035624c 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);