]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/statd.c
statd - keep persistent state in sm/* files.
[nfs-utils.git] / utils / statd / statd.c
index 157de853bf5aa4fbab1d6cc655f40beb6b806bca..a44f39f2394097863c14de256801984d9e6907f3 100644 (file)
@@ -230,12 +230,10 @@ static void run_sm_notify(int outport)
                av[ac++] = op;
        }
        if (run_mode & STATIC_HOSTNAME) {
-               av[ac++] = "-N";
+               av[ac++] = "-v";
                av[ac++] = MY_NAME;
        }
        av[ac] = NULL;
-       fprintf(stderr, "%s: -N deprecated, consider using /usr/sbin/sm-notify directly\n",
-               name_p);
        execv(av[0], av);
        fprintf(stderr, "%s: failed to run %s\n", name_p, av[0]);
        exit(2);
@@ -369,8 +367,11 @@ int main (int argc, char **argv)
                exit(-1);
        }
 
-       if (run_mode & MODE_NOTIFY_ONLY)
+       if (run_mode & MODE_NOTIFY_ONLY) {
+               fprintf(stderr, "%s: -N deprecated, consider using /usr/sbin/sm-notify directly\n",
+                       name_p);
                run_sm_notify(out_port);
+       }
 
 
        if (!(run_mode & MODE_NODAEMON)) {
@@ -475,6 +476,14 @@ int main (int argc, char **argv)
                        waitpid(pid, NULL, 0);
                }
 
+       /* Make sure we have a privilege port for calling into the kernel */
+       statd_get_socket();
+
+       /* If sm-notify didn't take all the state files, load
+        * state information into our notify-list so we can
+        * pass on any SM_NOTIFY that arrives
+        */
+       load_state();
 
        for (;;) {
                pmap_unset (SM_PROG, SM_VERS);