correctly provide nfs-utils_env.sh [release 1.3.4-2mamba;Sun Oct 30 2016]

This commit is contained in:
Silvan Calarco 2024-01-06 07:37:49 +01:00
parent b81fdbc2f1
commit 9076b9103e
3 changed files with 103 additions and 17 deletions

View File

@ -1,7 +1,42 @@
#RPCIDMAPDARGS=""
#RPCMOUNTDARGS=""
#RPCNFSDARGS=""
#GSSDARGS=""
#SMNOTIFYARGS=""
#STATDARGS=""
#SVCGSSDARGS=""
#
# Optional arguments passed to in-kernel lockd
#LOCKDARG=
# TCP port rpc.lockd should listen on.
#LOCKD_TCPPORT=32803
# UDP port rpc.lockd should listen on.
#LOCKD_UDPPORT=32769
#
# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8)
RPCNFSDARGS=""
# Number of nfs server processes to be started.
# The default is 8.
# RPCNFSDCOUNT=16
#
# Set V4 grace period in seconds
#NFSD_V4_GRACE=90
#
# Set V4 lease period in seconds
#NFSD_V4_LEASE=90
#
# Optional arguments passed to rpc.mountd. See rpc.mountd(8)
RPCMOUNTDOPTS=""
#
# Optional arguments passed to rpc.statd. See rpc.statd(8)
STATDARG=""
# Optional arguments passed to sm-notify. See sm-notify(8)
SMNOTIFYARGS=""
#
#
# Optional arguments passed to rpc.idmapd. See rpc.idmapd(8)
RPCIDMAPDARGS=""
#
# Optional arguments passed to rpc.gssd. See rpc.gssd(8)
RPCGSSDARGS=""
# Enable usage of gssproxy. See gssproxy-mech(8).
GSS_USE_PROXY="yes"
#
# Optional arguments passed to rpc.svcgssd. See rpc.svcgssd(8)
RPCSVCGSSDARGS=""
#
# Optional arguments passed to blkmapd. See blkmapd(8)
BLKMAPDARGS=""

View File

@ -9,7 +9,7 @@
Name: nfs-utils
Version: 1.3.4
Release: 1mamba
Release: 2mamba
Summary: NFS utilities and supporting clients and daemons for the kernel NFS server
Group: Network/File Systems
Vendor: openmamba
@ -19,6 +19,7 @@ URL: http://nfs.sourceforge.net
#Source0: http://www.kernel.org/pub/linux/utils/nfs/nfs-utils-%{version}.tar.bz2
Source0: http://downloads.sourceforge.net/project/nfs/nfs-utils/%{version}/nfs-utils-%{version}.tar.bz2
Source1: nfs-utils-sysconfig
Source2: nfs-utils_env.sh
Source7: nfs-utils-idmapd.conf
Patch0: %{name}-1.2.5-arm-PAGE_SIZE.patch
Patch1: nfs-utils-1.3.3-rundir.patch
@ -135,14 +136,7 @@ touch %{buildroot}%{_sysconfdir}/exports
install -D -m0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/nfs
install -d -m0755 %{buildroot}%{_prefix}/lib/systemd/scripts
cat >> %{buildroot}%{_prefix}/lib/systemd/scripts/nfs-utils_env.sh << _EOF
#!/bin/sh
cp /etc/sysconfig/nfs /run/nfs-utils
_EOF
chmod +x %{buildroot}%{_prefix}/lib/systemd/scripts/nfs-utils_env.sh
install -D -m0755 %{SOURCE2} %{buildroot}%{_prefix}/libexec/nfs-utils/nfs-utils_env.sh
%pre
if [ $1 -ge 1 ]; then
@ -225,7 +219,7 @@ fi
%{_unitdir}/nfs-mountd.service
%{_unitdir}/rpc-gssd.service
%{_unitdir}/rpc-statd-notify.service
%{_prefix}/lib/systemd/scripts/nfs-utils_env.sh
%{_prefix}/libexec/nfs-utils/nfs-utils_env.sh
%dir %attr(-,rpcuser,rpcuser) /var/lib/nfs
%dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd
%dir /var/lib/nfs/v4recovery
@ -282,6 +276,9 @@ fi
%{_mandir}/man7/nfsd.7*
%changelog
* Sun Oct 30 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.4-2mamba
- correctly provide nfs-utils_env.sh
* Tue Oct 04 2016 Automatic Build System <autodist@mambasoft.it> 1.3.4-1mamba
- automatic version update by autodist

54
nfs-utils_env.sh Normal file
View File

@ -0,0 +1,54 @@
#!/bin/sh
#
# Extract configuration from /etc/sysconfig/nfs and write
# environment variables to /run/sysconfig/nfs-utils to be
# used by systemd nfs-config service
#
nfs_config=/etc/sysconfig/nfs
if test -r $nfs_config; then
. $nfs_config
fi
[ -n "$LOCKDARG" ] && /usr/bin/modprobe lockd $LOCKDARG
if [ -n "$LOCKD_TCPPORT" -o -n "$LOCKD_UDPPORT" ]; then
[ -z "$LOCKDARG" ] && /usr/bin/modprobe lockd $LOCKDARG
[ -n "$LOCKD_TCPPORT" ] && \
/usr/bin/sysctl -w fs.nfs.nlm_tcpport=$LOCKD_TCPPORT >/dev/null 2>&1
[ -n "$LOCKD_UDPPORT" ] && \
/usr/bin/sysctl -w fs.nfs.nlm_udpport=$LOCKD_UDPPORT >/dev/null 2>&1
fi
if [ -n "$NFSD_V4_GRACE" ]; then
grace="-G $NFSD_V4_GRACE"
fi
if [ -n "$NFSD_V4_LEASE" ]; then
lease="-L $NFSD_V4_LEASE"
fi
if [ -n "$RPCNFSDCOUNT" ]; then
nfsds=$RPCNFSDCOUNT
else
nfsds=8
fi
if [ -n "$RPCNFSDARGS" ]; then
nfsdargs="$RPCNFSDARGS $grace $lease $nfsds"
else
nfsdargs="$grace $lease $nfsds"
fi
mkdir -p /run/sysconfig
{
echo RPCNFSDARGS=\"$nfsdargs\"
echo RPCMOUNTDARGS=\"$RPCMOUNTDOPTS\"
echo STATDARGS=\"$STATDARG\"
echo SMNOTIFYARGS=\"$SMNOTIFYARGS\"
echo RPCIDMAPDARGS=\"$RPCIDMAPDARGS\"
echo RPCGSSDARGS=\"$RPCGSSDARGS\"
echo RPCSVCGSSDARGS=\"$RPCSVCGSSDARGS\"
echo BLKMAPDARGS=\"$BLKMAPDARGS\"
echo GSS_USE_PROXY=\"$GSS_USE_PROXY\"
} > /run/sysconfig/nfs-utils