[packages/nfs-utils] - added config generator for upstream systemd services (not used yet) - use upstream systemd mounts

baggins baggins at pld-linux.org
Mon May 26 20:52:44 CEST 2014


commit fc0abeb03a9a9af2cbaebddc3bc8ed789f4f5bf3
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon May 26 20:51:45 2014 +0200

    - added config generator for upstream systemd services (not used yet)
    - use upstream systemd mounts (same as ours)

 nfs-utils.spec               |  7 +++---
 nfs-utils_env.sh             | 53 ++++++++++++++++++++++++++++++++++++++++++++
 proc-fs-nfsd.mount           |  8 -------
 var-lib-nfs-rpc_pipefs.mount |  8 -------
 4 files changed, 56 insertions(+), 20 deletions(-)
---
diff --git a/nfs-utils.spec b/nfs-utils.spec
index d05fa0f..2d0d869 100644
--- a/nfs-utils.spec
+++ b/nfs-utils.spec
@@ -30,8 +30,7 @@ Source9:	nfslock.sysconfig
 Source10:	nfsfs.sysconfig
 Source11:	blkmapd.init
 Source12:	sunrpc.conf
-Source100:	proc-fs-nfsd.mount
-Source101:	var-lib-nfs-rpc_pipefs.mount
+Source13:	nfs-utils_env.sh
 Source102:	nfsd.service
 Source103:	nfs-blkmapd.service
 Source104:	nfs-exportfs.service
@@ -258,8 +257,8 @@ install %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/nfsfs
 
 install %{SOURCE12} $RPM_BUILD_ROOT/etc/modprobe.d/sunrpc.conf
 
-install %{SOURCE100} $RPM_BUILD_ROOT%{systemdunitdir}/proc-fs-nfsd.mount
-install %{SOURCE101} $RPM_BUILD_ROOT%{systemdunitdir}/var-lib-nfs-rpc_pipefs.mount
+install systemd/proc-fs-nfsd.mount $RPM_BUILD_ROOT%{systemdunitdir}/proc-fs-nfsd.mount
+install systemd/var-lib-nfs-rpc_pipefs.mount $RPM_BUILD_ROOT%{systemdunitdir}/var-lib-nfs-rpc_pipefs.mount
 install %{SOURCE102} $RPM_BUILD_ROOT%{systemdunitdir}/nfsd.service
 install %{SOURCE103} $RPM_BUILD_ROOT%{systemdunitdir}/blkmapd.service
 install %{SOURCE104} $RPM_BUILD_ROOT%{systemdunitdir}/nfsd-exportfs.service
diff --git a/nfs-utils_env.sh b/nfs-utils_env.sh
new file mode 100644
index 0000000..6d2323d
--- /dev/null
+++ b/nfs-utils_env.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# extract configuration from /etc/sysconfig/nfs* and write
+# environment to /run/sysconfig/nfs-utils to be used by systemd unit
+# files.
+
+[ -f /etc/sysconfig/nfslock ] && . /etc/sysconfig/nfslock
+[ -f /etc/sysconfig/nfsfs ] && . /etc/sysconfig/nfsfs
+[ -f /etc/sysconfig/nfsd ] && . /etc/sysconfig/nfsd
+
+STATDARGS="$STATDOPTIONS"
+
+# Set the ports lockd should listen on
+if [ -n "$LOCKD_TCPPORT" ]; then
+	STATDARGS="$STATDARGS -T $LOCKD_TCPPORT"
+	/sbin/sysctl -w fs.nfs.nlm_tcpport=$LOCKD_TCPPORT >/dev/null 2>&1
+fi
+if [ -n "$LOCKD_UDPPORT" ]; then
+	STATDARGS="$STATDARGS -U $LOCKD_UDPPORT"
+	/sbin/sysctl -w fs.nfs.nlm_udpport=$LOCKD_UDPPORT >/dev/null 2>&1
+fi
+
+# Set v4 grace period if requested
+if [ -n "$NFSD_V4_GRACE" ]; then
+	echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4gracetime >/dev/null 2>&1
+fi
+
+RPCMOUNTDARGS="$RPCMOUNTDOPTIONS"
+SVCGSSDARGS="$RPCSVCGSSOPTIONS"
+RPCIDMAPDARGS="$RPCIDMAPOPTIONS"
+GSSDARGS="$RPCGSSOPTIONS"
+if [ "$RPCNFSDCOUNT" -gt 0 ]; then
+	RPCNFSDARGS="$RPCNFSDCOUNT"
+else
+	RPCNFSDARGS="8"
+fi
+if [ -n "$RPCNFSDOPTIONS" ]; then
+	RPCNFSDARGS="$RPCNFSDOPTIONS $RPCNFSDARGS"
+fi
+
+BLKMAPDARGS="$BLKMAPDOPTIONS"
+
+#mkdir -p /run/sysconfig
+{
+	[ -z "$STATDARGS" ] || echo STATDARGS=\""$STATDARGS"\"
+	[ -z "$RPCMOUNTDARGS" ] || echo RPCMOUNTDARGS=\""$RPCMOUNTDARGS"\"
+	[ -z "$SVCGSSDARGS" ] || echo SVCGSSDARGS=\""$SVCGSSDARGS"\"
+	[ -z "$RPCIDMAPDARGS" ] || echo RPCIDMAPDARGS=\""$RPCIDMAPDARGS"\"
+	[ -z "$GSSDARGS" ] || echo GSSDARGS=\""$GSSDARGS"\"
+	[ -z "$RPCNFSDARGS" ] || echo RPCNFSDARGS=\""$RPCNFSDARGS"\"
+	[ -z "$BLKMAPDARGS" ] || echo BLKMAPDARGS=\""$BLKMAPDARGS"\"
+} > xxx
+#} > /run/sysconfig/nfs-utils
diff --git a/proc-fs-nfsd.mount b/proc-fs-nfsd.mount
deleted file mode 100644
index e5ee6fb..0000000
--- a/proc-fs-nfsd.mount
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=RPC Pipe File System 
-DefaultDependencies=no
-
-[Mount]
-What=sunrpc
-Where=/proc/fs/nfsd
-Type=nfsd
diff --git a/var-lib-nfs-rpc_pipefs.mount b/var-lib-nfs-rpc_pipefs.mount
deleted file mode 100644
index d27e1a2..0000000
--- a/var-lib-nfs-rpc_pipefs.mount
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=RPC Pipe File System 
-DefaultDependencies=no
-
-[Mount]
-What=sunrpc
-Where=/var/lib/nfs/rpc_pipefs
-Type=rpc_pipefs
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nfs-utils.git/commitdiff/fc0abeb03a9a9af2cbaebddc3bc8ed789f4f5bf3



More information about the pld-cvs-commit mailing list