]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/statd.c
See ChangeLog
[nfs-utils.git] / utils / statd / statd.c
index b1e73046c1285f5c64f6ed242a9f95c13c45b9c4..127e2580516d461d3a6fe0eeeed5ab4b1e227561 100644 (file)
@@ -93,7 +93,9 @@ static void
 killer (int sig)
 {
        log (L_FATAL, "Caught signal %d, un-registering and exiting.", sig);
-       pmap_unset (SM_PROG, SM_VERS);
+       if (!(run_mode & MODE_NOTIFY_ONLY))
+               pmap_unset (SM_PROG, SM_VERS);
+
        exit (0);
 }
 
@@ -307,7 +309,14 @@ int main (int argc, char **argv)
        statd_get_socket(out_port);
 
        for (;;) {
-               pmap_unset (SM_PROG, SM_VERS);
+               if (!(run_mode & MODE_NOTIFY_ONLY)) {
+                       /* Do not do pmap_unset() when running in notify mode.
+                        * We may clear the portmapper record for a statd not
+                        * running in notify mode disabling it.
+                        * Juan C. Gomez j_carlos_gomez@yahoo.com
+                        */
+                       pmap_unset (SM_PROG, SM_VERS);
+               }
                change_state ();
                shuffle_dirs ();        /* Move directory names around */
                notify_hosts ();        /* Send out notify requests */