Skip to contentSkip to conversation

exportd: The NFSv4 only mounting daemon.

PATCH Superseded Steve Dickson 1 participant 7 messages Feb 17, 2021

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover exportd: The NFSv4 only mounting daemon.

exportd is a daemon that will listen for only v4 mount upcalls. The idea is to allow distros to build a v4 only package which will have a much smaller footprint than the entire nfs-utils package.

exportd uses no RPC code, which means none of the
code or arguments that deal with v3 was ported,
this again, makes the footprint much smaller.

The following options were ported:
* multiple threads
* state-directory-path option
* junction support (not tested)

The rest of the mountd options were v3 only options.

V2:
* Added two systemd services: nfsv4-exportd and nfsv4-server
* nfsv4-server starts rpc.nfsd -N 3, so nfs.conf mod not needed.

Steve Dickson (6):
exportd: the initial shell of the v4 export support
exportd: Moved cache upcalls routines into libexport.a
exportd: multiple threads
exportd/exportfs: Add the state-directory-path option
exportd: Enabled junction support
exportd: systemd unit files

 .gitignore                                |   1 +
 configure.ac                              |   1 +
 nfs.conf                                  |   4 +
 support/export/Makefile.am                |   3 +-
 {utils/mountd => support/export}/auth.c   |   4 +-
 {utils/mountd => support/export}/cache.c  |  46 +++-
 support/export/export.h                   |  34 +++
 {utils/mountd => support/export}/fsloc.c  |   0
 {utils/mountd => support/export}/v4root.c |   0
 {utils/mountd => support/include}/fsloc.h |   0
 systemd/nfs.conf.man                      |  10 +
 systemd/nfsv4-exportd.service             |  12 +
 systemd/nfsv4-server.service              |  31 +++
 utils/Makefile.am                         |   1 +
 utils/exportd/Makefile.am                 |  63 +++++
 utils/exportd/exportd.c                   | 276 ++++++++++++++++++++++
 utils/exportd/exportd.man                 |  81 +++++++
 utils/exportfs/exportfs.c                 |  25 +-
 utils/exportfs/exportfs.man               |   7 +-
 utils/mountd/Makefile.am                  |   5 +-
 20 files changed, 586 insertions(+), 18 deletions(-)
 rename {utils/mountd => support/export}/auth.c (99%)
 rename {utils/mountd => support/export}/cache.c (98%)
 create mode 100644 support/export/export.h
 rename {utils/mountd => support/export}/fsloc.c (100%)
 rename {utils/mountd => support/export}/v4root.c (100%)
 rename {utils/mountd => support/include}/fsloc.h (100%)
 create mode 100644 systemd/nfsv4-exportd.service
 create mode 100644 systemd/nfsv4-server.service
 create mode 100644 utils/exportd/Makefile.am
 create mode 100644 utils/exportd/exportd.c
 create mode 100644 utils/exportd/exportd.man
Signature · 1 line
2.29.2
#3 lore raw

PATCH v2 3/6 exportd: multiple threads

Ported the multiple thread code from mountd (commit 11d34d11)

---
 nfs.conf                  |   3 +
 systemd/nfs.conf.man      |   9 +++
 utils/exportd/exportd.c   | 118 ++++++++++++++++++++++++++++++++++++--
 utils/exportd/exportd.man |   7 +++
 4 files changed, 133 insertions(+), 4 deletions(-)
nfs.conf +3 -0
index 9fcf1bf..4b344fa 100644
@@ -29,6 +29,9 @@
 # port=0
 # udp-port=0
 #
+[exportd]
+# debug="all|auth|call|general|parse"
+# threads=1
 [mountd]
 # debug="all|auth|call|general|parse"
 # manage-gids=n
systemd/nfs.conf.man +9 -0
index 16e0ec4..a4379fd 100644
@@ -128,6 +128,15 @@ then the client will be able to mount the path as
 but on the server, this will resolve to the path
 .BR /my/root/filesystem .
 
+.TP
+.B exportd
+Recognized values:
+.B threads
+
+See
+.BR exportd (8)
+for details.
+
 .TP
 .B nfsdcltrack
 Recognized values:
utils/exportd/exportd.c +114 -4

174 lines not on this page · raw message

utils/exportd/exportd.man +7 -0
index 96e133c..fae47d0 100644
@@ -44,6 +44,13 @@ Run in foreground (do not daemonize)
 .TP
 .B \-h " or " \-\-help
 Display usage message.
+.TP
+.BR "\-t N" " or " "\-\-num\-threads=N " or  " \-\-num\-threads N "
+This option specifies the number of worker threads that rpc.mountd
+spawns.  The default is 1 thread, which is probably enough.  More
+threads are usually only needed for NFS servers which need to handle
+mount storms of hundreds of NFS mounts in a few seconds, or when
+your DNS server is slow or unreliable.
 .SH CONFIGURATION FILE
 Many of the options that can be set on the command line can also be
 controlled through values set in the
Signature · 1 line
2.29.2
#1 lore raw

PATCH v2 1/6 exportd: the initial shell of the v4 export support

In reply to Steve Dickson
---
 .gitignore                |   1 +
 configure.ac              |   1 +
 utils/Makefile.am         |   1 +
 utils/exportd/Makefile.am |  56 ++++++++++++++++++
 utils/exportd/exportd.c   | 121 ++++++++++++++++++++++++++++++++++++++
 utils/exportd/exportd.man |  74 +++++++++++++++++++++++
 6 files changed, 254 insertions(+)
 create mode 100644 utils/exportd/Makefile.am
 create mode 100644 utils/exportd/exportd.c
 create mode 100644 utils/exportd/exportd.man
.gitignore +1 -0
index e97b31f..c89d1cd 100644
@@ -47,6 +47,7 @@ utils/idmapd/idmapd
 utils/lockd/lockd
 utils/mount/mount.nfs
 utils/mountd/mountd
+utils/exportd/exportd
 utils/nfsd/nfsd
 utils/nfsstat/nfsstat
 utils/nhfsstone/nhfsstone
configure.ac +1 -0
index 50847d8..ffd6247 100644
@@ -706,6 +706,7 @@ AC_CONFIG_FILES([
 	utils/idmapd/Makefile
 	utils/mount/Makefile
 	utils/mountd/Makefile
+	utils/exportd/Makefile
 	utils/nfsd/Makefile
 	utils/nfsref/Makefile
 	utils/nfsstat/Makefile
utils/Makefile.am +1 -0
index 4c930a4..4638e97 100644
@@ -34,6 +34,7 @@ endif
 SUBDIRS = \
 	exportfs \
 	mountd \
+	exportd \
 	nfsd \
 	nfsstat \
 	showmount \
utils/exportd/Makefile.am new file +56 -0

56 lines not on this page · raw message

utils/exportd/exportd.c new file +121 -0

121 lines not on this page · raw message

utils/exportd/exportd.man new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.29.2
#5 lore raw

PATCH v2 5/6 exportd: Enabled junction support

In reply to Steve Dickson

Moved the junction support from mountd to libexport.a so both exportd and mountd can use the code.

---
 support/export/Makefile.am                | 2 +-
 {utils/mountd => support/export}/fsloc.c  | 0
 {utils/mountd => support/include}/fsloc.h | 0
 utils/exportd/Makefile.am                 | 5 ++++-
 utils/mountd/Makefile.am                  | 3 +--
 5 files changed, 6 insertions(+), 4 deletions(-)
 rename {utils/mountd => support/export}/fsloc.c (100%)
 rename {utils/mountd => support/include}/fsloc.h (100%)
support/export/Makefile.am +1 -1
index 7de82a8..a9e710c 100644
@@ -12,7 +12,7 @@ EXTRA_DIST	= mount.x
 noinst_LIBRARIES = libexport.a
 libexport_a_SOURCES = client.c export.c hostname.c \
 		      xtab.c mount_clnt.c mount_xdr.c \
-			  cache.c auth.c v4root.c
+			  cache.c auth.c v4root.c fsloc.c
 BUILT_SOURCES 	= $(GENFILES)
 
 noinst_HEADERS = mount.h
support/export/fsloc.c renamed from utils/mountd/fsloc.c +0 -0
similarity index 100%
rename from utils/mountd/fsloc.c
rename to support/export/fsloc.c
support/include/fsloc.h renamed from utils/mountd/fsloc.h +0 -0
similarity index 100%
rename from utils/mountd/fsloc.h
rename to support/include/fsloc.h
utils/exportd/Makefile.am +4 -1
index 0fcd92f..2fd3ba1 100644
@@ -1,6 +1,9 @@
 ## Process this file with automake to produce Makefile.in
 
-OPTLIBS     =
+OPTLIBS		=
+if CONFIG_JUNCTION
+OPTLIBS		+= ../../support/junction/libjunction.la $(LIBXML2)
+endif
 
 man8_MANS   = exportd.man
 EXTRA_DIST  = $(man8_MANS)
utils/mountd/Makefile.am +1 -2
index cac3275..859f28e 100644
@@ -12,9 +12,8 @@ RPCPREFIX	= rpc.
 KPREFIX		= @kprefix@
 sbin_PROGRAMS	= mountd
 
-noinst_HEADERS = fsloc.h
 mountd_SOURCES = mountd.c mount_dispatch.c rmtab.c \
-		 svc_run.c fsloc.c mountd.h
+		 svc_run.c mountd.h
 mountd_LDADD = ../../support/export/libexport.a \
 	       ../../support/nfs/libnfs.la \
 	       ../../support/misc/libmisc.a \
Signature · 1 line
2.29.2
#2 lore raw

PATCH v2 2/6 exportd: Moved cache upcalls routines into libexport.a

In reply to Steve Dickson

Move the cache management code into libexport.a
so both mountd and exportd can use it.

Introduce cache_proccess_loop() which will
be used by exportd, instead of my_svc_run().

---
 support/export/Makefile.am                |  3 +-
 {utils/mountd => support/export}/auth.c   |  4 +-
 {utils/mountd => support/export}/cache.c  | 46 +++++++++++++++++++++--
 support/export/export.h                   | 34 +++++++++++++++++
 {utils/mountd => support/export}/v4root.c |  0
 utils/exportd/Makefile.am                 | 12 ++++--
 utils/exportd/exportd.c                   | 30 ++++++++++++++-
 utils/mountd/Makefile.am                  |  4 +-
 8 files changed, 120 insertions(+), 13 deletions(-)
 rename {utils/mountd => support/export}/auth.c (99%)
 rename {utils/mountd => support/export}/cache.c (98%)
 create mode 100644 support/export/export.h
 rename {utils/mountd => support/export}/v4root.c (100%)
support/export/Makefile.am +2 -1
index 13f7a49..7de82a8 100644
@@ -11,7 +11,8 @@ EXTRA_DIST	= mount.x
 
 noinst_LIBRARIES = libexport.a
 libexport_a_SOURCES = client.c export.c hostname.c \
-		      xtab.c mount_clnt.c mount_xdr.c
+		      xtab.c mount_clnt.c mount_xdr.c \
+			  cache.c auth.c v4root.c
 BUILT_SOURCES 	= $(GENFILES)
 
 noinst_HEADERS = mount.h
support/export/auth.c renamed from utils/mountd/auth.c +3 -1
similarity index 99%
rename from utils/mountd/auth.c
rename to support/export/auth.c
index 67627f7..0bfa77d 100644
@@ -22,7 +22,7 @@
 #include "misc.h"
 #include "nfslib.h"
 #include "exportfs.h"
-#include "mountd.h"
+#include "export.h"
 #include "v4root.h"
 
 enum auth_error
@@ -43,11 +43,13 @@ extern int use_ipaddr;
 
 extern struct state_paths etab;
 
+/*
 void
 auth_init(void)
 {
 	auth_reload();
 }
+*/
 
 /*
  * A client can match many different netgroups and it's tough to know
support/export/cache.c renamed from utils/mountd/cache.c +43 -3

86 lines not on this page · raw message

support/export/export.h new file +34 -0
new file mode 100644
index 0000000..4296db1
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2021 Red Hat <[email protected]>
+ *
+ * support/export/export.h
+ *
+ * Declarations for export support 
+ */
+
+#ifndef EXPORT_H
+#define EXPORT_H
+
+#include "nfslib.h"
+
+unsigned int	auth_reload(void);
+nfs_export *	auth_authenticate(const char *what,
+					const struct sockaddr *caller,
+					const char *path);
+
+void		cache_open(void);
+void		cache_process_loop(void);
+
+struct nfs_fh_len *
+		cache_get_filehandle(nfs_export *exp, int len, char *p);
+int		cache_export(nfs_export *exp, char *path);
+
+bool ipaddr_client_matches(nfs_export *exp, struct addrinfo *ai);
+bool namelist_client_matches(nfs_export *exp, char *dom);
+bool client_matches(nfs_export *exp, char *dom, struct addrinfo *ai);
+
+static inline bool is_ipaddr_client(char *dom)
+{
+	return dom[0] == '$';
+}
+#endif /* EXPORT__H */
support/export/v4root.c renamed from utils/mountd/v4root.c +0 -0
similarity index 100%
rename from utils/mountd/v4root.c
rename to support/export/v4root.c
utils/exportd/Makefile.am +8 -4
index 2314d32..0fcd92f 100644
@@ -7,10 +7,14 @@ EXTRA_DIST  = $(man8_MANS)
 
 sbin_PROGRAMS	=	exportd
 
-exportd_SOURCES = exportd.c 
-exportd_LDADD = ../../support/nfs/libnfs.la
-
-exportd_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS)
+exportd_SOURCES = exportd.c
+exportd_LDADD = ../../support/export/libexport.a \
+			../../support/nfs/libnfs.la \
+			../../support/misc/libmisc.a \
+			$(OPTLIBS) $(LIBBLKID) $(LIBPTHREAD) 
+
+exportd_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \
+		-I$(top_srcdir)/support/export
 
 MAINTAINERCLEANFILES = Makefile.in
 
utils/exportd/exportd.c +28 -2
index 53712fa..150938c 100644
@@ -18,7 +18,16 @@
 
 #include "nfslib.h"
 #include "conffile.h"
+#include "exportfs.h"
+#include "export.h"
 
+extern void my_svc_run(void);
+
+struct state_paths etab;
+struct state_paths rmtab;
+
+int manage_gids;
+int use_ipaddr = -1;
 
 static struct option longopts[] =
 {
@@ -36,7 +45,7 @@ inline static void set_signals(void);
 static void 
 killer (int sig)
 {
-	xlog (L_NOTICE, "Caught signal %d, un-registering and exiting.", sig);
+	xlog (L_NOTICE, "Caught signal %d, exiting.", sig);
 	exit(0);
 }
 static void
@@ -110,12 +119,29 @@ main(int argc, char **argv)
 
 	}
 
+	if (!setup_state_path_names(progname, ETAB, ETABTMP, ETABLCK, &etab))
+		return 1;
+	if (!setup_state_path_names(progname, RMTAB, RMTABTMP, RMTABLCK, &rmtab))
+		return 1;
+
 	if (!foreground) 
 		xlog_stderr(0);
 
 	daemon_init(foreground);
 
 	set_signals();
-	
 	daemon_ready();
+
+	/* Open files now to avoid sharing descriptors among forked processes */
+	cache_open();
+
+	/* Process incoming upcalls */
+	cache_process_loop();
+
+	xlog(L_ERROR, "%s: process loop terminated unexpectedly. Exiting...\n",
+		progname);
+
+	free_state_path_names(&etab);
+	free_state_path_names(&rmtab);
+	exit(1);
 }
utils/mountd/Makefile.am +2 -2
index 18610f1..cac3275 100644
@@ -13,8 +13,8 @@ KPREFIX		= @kprefix@
 sbin_PROGRAMS	= mountd
 
 noinst_HEADERS = fsloc.h
-mountd_SOURCES = mountd.c mount_dispatch.c auth.c rmtab.c cache.c \
-		 svc_run.c fsloc.c v4root.c mountd.h
+mountd_SOURCES = mountd.c mount_dispatch.c rmtab.c \
+		 svc_run.c fsloc.c mountd.h
 mountd_LDADD = ../../support/export/libexport.a \
 	       ../../support/nfs/libnfs.la \
 	       ../../support/misc/libmisc.a \
Signature · 1 line
2.29.2
#4 lore raw

PATCH v2 4/6 exportd/exportfs: Add the state-directory-path option

In reply to Steve Dickson

Ported state-directory-path option from mountd (commit a15bd948)

---
 nfs.conf                    |  1 +
 systemd/nfs.conf.man        |  3 ++-
 utils/exportd/exportd.c     | 35 +++++++++++++++++++++++++++--------
 utils/exportfs/exportfs.c   | 25 +++++++++++++++++--------
 utils/exportfs/exportfs.man |  7 +++++--
 5 files changed, 52 insertions(+), 19 deletions(-)
nfs.conf +1 -0
index 4b344fa..bebb2e3 100644
@@ -31,6 +31,7 @@
 #
 [exportd]
 # debug="all|auth|call|general|parse"
+# state-directory-path=/var/lib/nfs
 # threads=1
 [mountd]
 # debug="all|auth|call|general|parse"
systemd/nfs.conf.man +2 -1
index a4379fd..d2187f8 100644
@@ -131,7 +131,8 @@ but on the server, this will resolve to the path
 .TP
 .B exportd
 Recognized values:
-.B threads
+.BR threads ,
+.BR state-directory-path
 
 See
 .BR exportd (8)
utils/exportd/exportd.c +27 -8
index bf5f431..be6a2a5 100644
@@ -26,7 +26,6 @@
 extern void my_svc_run(void);
 
 struct state_paths etab;
-struct state_paths rmtab;
 
 /* Number of mountd threads to start.   Default is 1 and
  * that's probably enough unless you need hundreds of
@@ -80,6 +79,12 @@ wait_for_workers (void)
 	}
 }
 
+inline void
+cleanup_lockfiles (void)
+{
+	unlink(etab.lockfn);
+}
+
 /* Fork num_threads worker children and wait for them */
 static void
 fork_workers(void)
@@ -117,6 +122,8 @@ fork_workers(void)
 
 	/* in parent */
 	wait_for_workers();
+	cleanup_lockfiles();
+	free_state_path_names(&etab);
 	xlog(L_NOTICE, "exportd: no more workers, exiting\n");
 	exit(0);
 }
@@ -129,6 +136,8 @@ killer (int sig)
 		kill(0, SIGTERM);
 		wait_for_workers();
 	}
+	cleanup_lockfiles();
+	free_state_path_names(&etab);
 	xlog (L_NOTICE, "Caught signal %d, exiting.", sig);
 
 	exit(0);
@@ -159,24 +168,33 @@ set_signals(void)
 	sa.sa_handler = sig_hup;
 	sigaction(SIGHUP, &sa, NULL);
 }
+
 static void
 usage(const char *prog, int n)
 {
 	fprintf(stderr,
 		"Usage: %s [-f|--foreground] [-h|--help] [-d kind|--debug kind]\n"
+"	[-s|--state-directory-path path]\n"
 "	[-t num|--num-threads=num]\n", prog);
 	exit(n);
 }
 
 inline static void 
-read_exportd_conf(char *progname)
+read_exportd_conf(char *progname, char **argv)
 {
+	char *s;
+
 	conf_init_file(NFS_CONFFILE);
 
 	xlog_from_conffile(progname);
 
 	num_threads = conf_get_num("exportd", "threads", num_threads);
+
+	s = conf_get_str("exportd", "state-directory-path");
+	if (s && !state_setup_basedir(argv[0], s))
+		exit(1);
 }
+
 int
 main(int argc, char **argv)
 {
@@ -194,9 +212,9 @@ main(int argc, char **argv)
 	xlog_open(progname);
 
 	/* Read in config setting */
-	read_exportd_conf(progname);
+	read_exportd_conf(progname, argv);
 
-	while ((c = getopt_long(argc, argv, "d:fht:", longopts, NULL)) != EOF) {
+	while ((c = getopt_long(argc, argv, "d:fhs:t:", longopts, NULL)) != EOF) {
 		switch (c) {
 		case 'd':
 			xlog_sconfig(optarg, 1);
@@ -207,6 +225,10 @@ main(int argc, char **argv)
 		case 'h':
 			usage(progname, 0);
 			break;
+		case 's':
+			if (!state_setup_basedir(argv[0], optarg))
+				exit(1);
+			break;
 		case 't':
 			num_threads = atoi (optarg);
 			break;
@@ -219,9 +241,7 @@ main(int argc, char **argv)
 
 	if (!setup_state_path_names(progname, ETAB, ETABTMP, ETABLCK, &etab))
 		return 1;
-	if (!setup_state_path_names(progname, RMTAB, RMTABTMP, RMTABLCK, &rmtab))
-		return 1;
-
+	
 	if (!foreground) 
 		xlog_stderr(0);
 
@@ -252,6 +272,5 @@ main(int argc, char **argv)
 		progname);
 
 	free_state_path_names(&etab);
-	free_state_path_names(&rmtab);
 	exit(1);
 }
utils/exportfs/exportfs.c +17 -8
index 9fcae0b..fcab3b1 100644
@@ -91,7 +91,23 @@ release_lockfile()
 		_lockfd = -1;
 	}
 }
+inline static void 
+read_exportfs_conf(char **argv)
+{
+	char *s;
+
+	conf_init_file(NFS_CONFFILE);
+	xlog_from_conffile("exportfs");
+
+	/* NOTE: following uses "mountd" section of nfs.conf !!!! */
+	s = conf_get_str("mountd", "state-directory-path");
+	/* Also look in the exportd section */
+	if (s == NULL)
+		s = conf_get_str("exportd", "state-directory-path");
+	if (s && !state_setup_basedir(argv[0], s))
+		exit(1);
 
+}
 int
 main(int argc, char **argv)
 {
@@ -105,7 +121,6 @@ main(int argc, char **argv)
 	int	f_ignore = 0;
 	int	i, c;
 	int	force_flush = 0;
-	char	*s;
 
 	if ((progname = strrchr(argv[0], '/')) != NULL)
 		progname++;
@@ -116,15 +131,9 @@ main(int argc, char **argv)
 	xlog_stderr(1);
 	xlog_syslog(0);
 
-	conf_init_file(NFS_CONFFILE);
-	xlog_from_conffile("exportfs");
+	read_exportfs_conf(argv);
 	nfsd_path_init();
 
-	/* NOTE: following uses "mountd" section of nfs.conf !!!! */
-	s = conf_get_str("mountd", "state-directory-path");
-	if (s && !state_setup_basedir(argv[0], s))
-		exit(1);
-
 	while ((c = getopt(argc, argv, "ad:fhio:ruvs")) != EOF) {
 		switch(c) {
 		case 'a':
utils/exportfs/exportfs.man +5 -2
index 91d3589..6d417a7 100644
@@ -167,9 +167,11 @@ When a list is given, the members should be comma-separated.
 .B exportfs
 will also recognize the
 .B state-directory-path
-value from the
+value from both the 
 .B [mountd]
-section.
+section and the
+.B [exportd]
+section
 
 .SH DISCUSSION
 .SS Exporting Directories
@@ -327,6 +329,7 @@ table of clients accessing server's exports
 .BR exports (5),
 .BR nfs.conf (5),
 .BR rpc.mountd (8),
+.BR exportd (8),
 .BR netgroup (5)
 .SH AUTHORS
 Olaf Kirch <[email protected]>
Signature · 1 line
2.29.2
#6 lore raw

PATCH v2 6/6 exportd: systemd unit files

In reply to Steve Dickson

Created two new systemd unit services
based on nfs-mountd and nfs-service

---
 systemd/nfsv4-exportd.service | 12 ++++++++++++
 systemd/nfsv4-server.service  | 31 +++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 systemd/nfsv4-exportd.service
 create mode 100644 systemd/nfsv4-server.service
systemd/nfsv4-exportd.service new file +12 -0
new file mode 100644
index 0000000..abf2f42
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFSv4 Mount Daemon
+DefaultDependencies=no
+Requires=proc-fs-nfsd.mount
+Wants=network-online.target
+After=proc-fs-nfsd.mount
+After=network-online.target local-fs.target
+BindsTo=nfsv4-server.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/exportd
systemd/nfsv4-server.service new file +31 -0
new file mode 100644
index 0000000..6497568
@@ -0,0 +1,31 @@
+[Unit]
+Description=NFSv4 server and services
+DefaultDependencies=no
+Requires=network.target proc-fs-nfsd.mount
+Requires=nfsv4-exportd.service
+Wants=network-online.target
+Wants=nfs-idmapd.service
+Wants=nfsdcld.service
+
+After=network-online.target local-fs.target
+After=proc-fs-nfsd.mount nfsv4-exportd.service
+After=nfs-idmapd.service
+After=nfsdcld.service
+
+# GSS services dependencies and ordering
+Wants=auth-rpcgss-module.service
+After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStartPre=-/usr/sbin/exportfs -r
+ExecStart=/usr/sbin/rpc.nfsd -N 3
+ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStopPost=/usr/sbin/exportfs -au
+ExecStopPost=/usr/sbin/exportfs -f
+
+ExecReload=-/usr/sbin/exportfs -r
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.29.2