summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2012-11-19 18:17:30 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2012-11-19 18:28:08 +0000
commit57fda388539439eacd155e9e5dba5c061934f83d (patch)
tree1f27b1b8dc59fa8f7c7b2e7a2a567500c3086f9e
parentd726640ad4ecc22fd09a5af3cc3d46d3b0fd03d3 (diff)
downloadnfs-utils-57fda388539439eacd155e9e5dba5c061934f83d.tar.gz
Add systemd unit definitions
These are borrowed from Fedora No secure NFS service exists, because we don't yet build with rpcgss. The lockd does not have a service file, because it's largely useless[1]. 1. http://www.time-travellers.org/shane/papers/NFS_considered_harmful.html
-rw-r--r--nfs-server.service18
-rw-r--r--nfs-utils.morph6
-rw-r--r--proc-fs-nfsd.mount8
3 files changed, 32 insertions, 0 deletions
diff --git a/nfs-server.service b/nfs-server.service
new file mode 100644
index 0000000..c09e1e8
--- /dev/null
+++ b/nfs-server.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=NFS Server
+Requires=proc-fs-nfsd.mount rpcbind.service
+After=network.target named.service rpcbind.service proc-fs-nfsd.mount
+
+[Service]
+Type=forking
+StandardError=syslog+console
+EnvironmentFile=-/etc/sysconfig/nfs
+ExecStartPre=/usr/sbin/exportfs -r
+ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS ${RPCNFSDCOUNT}
+ExecStartPost=/usr/sbin/rpc.mountd $RPCMOUNTDOPTS
+ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStopPost=/usr/sbin/exportfs -f
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/nfs-utils.morph b/nfs-utils.morph
index 65c20e6..3d5a3e5 100644
--- a/nfs-utils.morph
+++ b/nfs-utils.morph
@@ -5,5 +5,11 @@
"configure-commands": [
"NOCONFIGURE=1 ./autogen.sh",
"./configure --prefix=\"$PREFIX\" --disable-nfsv4 --disable-nfsv41 --disable-gss --with-rpcgen=internal"
+ ],
+ "install-commands": [
+ "make DESTDIR=\"$DESTDIR\" install",
+ "mkdir -p \"$DESTDIR\"/lib/systemd/system",
+ "install -m644 proc-fs-nfsd.mount \"$DESTDIR\"/lib/systemd/system",
+ "install -m644 nfs-server.service \"$DESTDIR\"/lib/systemd/system"
]
}
diff --git a/proc-fs-nfsd.mount b/proc-fs-nfsd.mount
new file mode 100644
index 0000000..e5ee6fb
--- /dev/null
+++ b/proc-fs-nfsd.mount
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPC Pipe File System
+DefaultDependencies=no
+
+[Mount]
+What=sunrpc
+Where=/proc/fs/nfsd
+Type=nfsd