]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd state directory
authorNeil Brown <neilb@suse.de>
Mon, 5 Jun 2006 02:45:01 +0000 (12:45 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 5 Jun 2006 02:45:01 +0000 (12:45 +1000)
  Let the user select (via a new parameter) the path to the NFS
  state directory for mountd, to match the statd functionality.
         "Steinar H. Gunderson" <sesse@debian.org>

ChangeLog
utils/mountd/mountd.c
utils/mountd/mountd.man

index ebe9ae7dd961b592d5f5a371703a4b9434f8399b..c5401152fda61dde94eea7d94c27084badc9deed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
          Document the 'sync' option in the exports(5) man page -- ATM
          only the 'async' option is documented, which is not very
          symmetric. :-)  "Steinar H. Gunderson" <sesse@debian.org>
          Document the 'sync' option in the exports(5) man page -- ATM
          only the 'async' option is documented, which is not very
          symmetric. :-)  "Steinar H. Gunderson" <sesse@debian.org>
-
+       - mountd state directory:
+         Let the user select (via a new parameter) the path to the NFS
+         state directory for mountd, to match the statd functionality.
+                "Steinar H. Gunderson" <sesse@debian.org>
+       
 2006-04-12 NeilBrown <neilb@suse.de>
        Remove **/Makefile.in, aclocal.m4, configure, and
         support/include/config.h.in from source control
 2006-04-12 NeilBrown <neilb@suse.de>
        Remove **/Makefile.in, aclocal.m4, configure, and
         support/include/config.h.in from source control
index 9cf2a1f039853a8c78c1faa29f39cb42439efad7..43606dd39350c6e50abdb8206c5ace4a6d1e657f 100644 (file)
@@ -56,6 +56,7 @@ static struct option longopts[] =
        { "port", 1, 0, 'p' },
        { "no-tcp", 0, 0, 'n' },
        { "ha-callout", 1, 0, 'H' },
        { "port", 1, 0, 'p' },
        { "no-tcp", 0, 0, 'n' },
        { "ha-callout", 1, 0, 'H' },
+       { "state-directory-path", 1, 0, 's' },
        { NULL, 0, 0, 0 }
 };
 
        { NULL, 0, 0, 0 }
 };
 
@@ -457,6 +458,7 @@ int
 main(int argc, char **argv)
 {
        char    *export_file = _PATH_EXPORTS;
 main(int argc, char **argv)
 {
        char    *export_file = _PATH_EXPORTS;
+       char    *state_dir = NFS_STATEDIR;
        int     foreground = 0;
        int     port = 0;
        int     descriptors = 0;
        int     foreground = 0;
        int     port = 0;
        int     descriptors = 0;
@@ -466,7 +468,7 @@ main(int argc, char **argv)
 
        /* Parse the command line options and arguments. */
        opterr = 0;
 
        /* Parse the command line options and arguments. */
        opterr = 0;
-       while ((c = getopt_long(argc, argv, "o:n:Fd:f:p:P:hH:N:V:v", longopts, NULL)) != EOF)
+       while ((c = getopt_long(argc, argv, "o:n:Fd:f:p:P:hH:N:V:vs:", longopts, NULL)) != EOF)
                switch (c) {
                case 'o':
                        descriptors = atoi(optarg);
                switch (c) {
                case 'o':
                        descriptors = atoi(optarg);
@@ -506,6 +508,13 @@ main(int argc, char **argv)
                case 'n':
                        _rpcfdtype = SOCK_DGRAM;
                        break;
                case 'n':
                        _rpcfdtype = SOCK_DGRAM;
                        break;
+               case 's':
+                       if ((state_dir = xstrdup(optarg)) == NULL) {
+                               fprintf(stderr, "%s: xstrdup(%s) failed!\n",
+                                       argv[0], optarg);
+                               exit(1);
+                       }
+                       break;
                case 'V':
                        nfs_version |= 1 << (atoi (optarg) - 1);
                        break;
                case 'V':
                        nfs_version |= 1 << (atoi (optarg) - 1);
                        break;
@@ -523,9 +532,9 @@ main(int argc, char **argv)
        if (optind != argc || !(nfs_version & 0x7))
                usage(argv [0], 1);
 
        if (optind != argc || !(nfs_version & 0x7))
                usage(argv [0], 1);
 
-       if (chdir(NFS_STATEDIR)) {
+       if (chdir(state_dir)) {
                fprintf(stderr, "%s: chdir(%s) failed: %s\n",
                fprintf(stderr, "%s: chdir(%s) failed: %s\n",
-                       argv [0], NFS_STATEDIR, strerror(errno));
+                       argv [0], state_dir, strerror(errno));
                exit(1);
        }
 
                exit(1);
        }
 
@@ -620,6 +629,6 @@ usage(const char *prog, int n)
 "      [-o num|--descriptors num] [-f exports-file|--exports-file=file]\n"
 "      [-p|--port port] [-V version|--nfs-version version]\n"
 "      [-N version|--no-nfs-version version] [-n|--no-tcp]\n"
 "      [-o num|--descriptors num] [-f exports-file|--exports-file=file]\n"
 "      [-p|--port port] [-V version|--nfs-version version]\n"
 "      [-N version|--no-nfs-version version] [-n|--no-tcp]\n"
-"      [-H ha-callout-prog]\n", prog);
+"      [-H ha-callout-prog] [-s|--state-directory-path path]\n", prog);
        exit(n);
 }
        exit(n);
 }
index 64e508a26ea2768ad39ca98e4384b9c36162105f..bac44216691f195f156a4d55472ce052b1ad7c23 100644 (file)
@@ -119,6 +119,12 @@ The third will be the path that the client is mounting.
 The last is the number of concurrent mounts that we believe the client
 has of that path.
 .TP
 The last is the number of concurrent mounts that we believe the client
 has of that path.
 .TP
+.BI "\-P," "" " \-\-state\-directory\-path "  directory
+specify a directory in which to place statd state information.
+If this option is not specified the default of
+.BR /var/lib/nfs
+is used.
+.TP
 .B \-V " or " \-\-nfs-version
 This option can be used to request that
 .B rpc.mountd
 .B \-V " or " \-\-nfs-version
 This option can be used to request that
 .B rpc.mountd