provide nfs-utils_env.sh script and /etc/sysconfig/nfs [release 1.3.1-2mamba;Wed Oct 01 2014]

This commit is contained in:
Silvan Calarco 2024-01-06 07:37:49 +01:00
parent a527038372
commit 19cf46d3fb
8 changed files with 127 additions and 729 deletions

View File

@ -1,171 +0,0 @@
#!/bin/sh
#
# nfs This shell script takes care of starting and stopping
# the NFS services.
#
# chkconfig: - 55 15
# description: NFS is a popular protocol for file sharing across TCP/IP \
# networks. This service provides NFS server functionality, \
# which is configured via the /etc/exports file.
# probe: true
# config: /etc/sysconfig/nfs
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ -x /usr/sbin/rpc.nfsd ] || exit 0
[ -x /usr/sbin/rpc.mountd ] || exit 0
[ -x /usr/sbin/exportfs ] || exit 0
# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue.
[ -r /etc/exports ] || \
{ touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \
{ echo "/etc/exports does not exist" ; exit 0 ; }
# Check for and source configuration file otherwise set defaults
[ -r /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
[ -z "$MOUNTD_NFS_V2" ] && MOUNTD_NFS_V2=default
[ -z "$MOUNTD_NFS_V3" ] && MOUNTD_NFS_V3=default
# Number of servers to be started by default
[ -z "$RPCNFSDCOUNT" ] && RPCNFSDCOUNT=8
# Remote quota server
[ -z "$RQUOTAD" ] && RQUOTAD=`type -path rpc.rquotad`
# See how we were called.
case "$1" in
start)
# Start daemons.
[ -x /sbin/rpc.statd ] && /sbin/service nfslock start
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd start
# Set the ports lockd should listen on
if [ -n "$LOCKD_TCPPORT" ]; then
/sbin/sysctl -w fs.nfs.nlm_tcpport=$LOCKD_TCPPORT >/dev/null 2>&1
fi
if [ -n "$LOCKD_UDPPORT" ]; then
/sbin/sysctl -w fs.nfs.nlm_udpport=$LOCKD_UDPPORT >/dev/null 2>&1
fi
if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
echo -n $"Starting NFS quotas: "
[ -n "$RQUOTAD_PORT" ] \
&& RPCRQUOTADOPTS="$RPCRQUOTADOPTS -p $RQUOTAD_PORT"
daemon rpc.rquotad $RPCRQUOTADOPTS
echo
fi
echo -n $"Starting NFS daemon: "
daemon rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT
echo
action $"Starting NFS services: " /usr/sbin/exportfs -r
[ -n "$MOUNTD_PORT" ] \
&& RPCMOUNTDOPTS="$RPCMOUNTDOPTS -p $MOUNTD_PORT"
case $MOUNTD_NFS_V1 in
no|NO)
RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 1" ;;
esac
case $MOUNTD_NFS_V2 in
no|NO)
RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 2" ;;
esac
case $MOUNTD_NFS_V3 in
no|NO)
RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3" ;;
esac
echo -n $"Starting NFS mountd: "
daemon rpc.mountd $RPCMOUNTDOPTS
echo
touch /var/lock/subsys/nfs
# Let rpc.idmapd know that rpc.mountd just started
[ -x /usr/sbin/rpc.idmapd ] && /sbin/service rpcidmapd condstart
;;
stop)
# Stop daemons.
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd stop
echo -n $"Shutting down NFS mountd: "
killproc rpc.mountd
echo
echo -n $"Shutting down NFS daemon: "
killproc nfsd
echo
if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
echo -n $"Shutting down NFS quotas: "
killproc rpc.rquotad
echo
fi
# Reset the lockd ports if they were set
if [ -n "$LOCKD_TCPPORT" ]; then
/sbin/sysctl -w fs.nfs.nlm_tcpport=0 >/dev/null 2>&1
fi
if [ -n "$LOCKD_UDPPORT" ]; then
/sbin/sysctl -w fs.nfs.nlm_udpport=0 >/dev/null 2>&1
fi
# Do it the last so that clients can still access the server
# when the server is running.
action $"Shutting down NFS services: " /usr/sbin/exportfs -au
rm -f /var/lock/subsys/nfs
;;
status)
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd status
status rpc.mountd
status nfsd
if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
status rpc.rquotad
fi
;;
restart)
$0 stop
$0 start
;;
reload)
/usr/sbin/exportfs -r
touch /var/lock/subsys/nfs
;;
probe)
if [ ! -f /var/lock/subsys/nfs ] ; then
echo $"start"; exit 0
fi
/sbin/pidof rpc.mountd >/dev/null 2>&1; MOUNTD="$?"
/sbin/pidof nfsd >/dev/null 2>&1; NFSD="$?"
if [ $MOUNTD = 1 -o $NFSD = 1 ] ; then
echo $"restart"; exit 0
fi
if [ /etc/exports -nt /var/lock/subsys/nfs ] ; then
echo $"reload"; exit 0
fi
;;
condrestart)
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condrestart
[ -f /var/lock/subsys/nfs ] && {
$0 stop
$0 start
}
;;
*)
echo $"Usage: nfs {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit 0

View File

@ -1,31 +0,0 @@
# For more information on nfs tuning, please see the NFS-HOWTO
# http://nfs.sourceforge.net/nfs-howto/
# Pass any additional options for mountd.
# MOUNTD_OPTIONS=
# Pin mountd to a given port rather than random one from portmapper
# MOUNTD_PORT=
# Don't advertise TCP for mount.
# MOUNTD_TCP=no
# NFS V3
# MOUNTD_NFS_V3=auto|yes|no
# NFS V2
# MOUNTD_NFS_V2=auto|yes|no
# The number of open file descriptors
# MOUNTD_OPEN_FILES=128
# Pass the number of instances of nfsd (8 is default; 16 or more
# might be needed to handle heavy client traffic)
# NFSDCOUNT=8
# Increase the memory limits on the socket input queues for
# the nfs processes .. NFS benchmark SPECsfs demonstrate a
# need for a larger than default size (64kb) .. setting
# TUNE_QUEUE to yes will set the values to 256kb.
# TUNE_QUEUE="yes"
# NFS_QS=262144

View File

@ -1,136 +0,0 @@
#!/bin/sh
#
# nfslock This shell script takes care of starting and stopping
# the NFS file locking service.
#
# chkconfig: 345 31 50
# description: NFS is a popular protocol for file sharing across \
# TCP/IP networks. This service provides NFS file \
# locking functionality.
# probe: true
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
[ -r /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ -x /sbin/rpc.statd ] || exit 0
RETVAL=0
if [ -n "${STATD_HOSTNAME}" ]; then
STATDARG="-n ${STATD_HOSTNAME}"
else
STATDARG=""
fi
start() {
# Make sure rpc.statd is not already running
if status rpc.statd > /dev/null; then
exit 0
fi
rm -f /var/lock/subsys/rpc.statd
# Make sure locks are recovered
rm -f /var/run/sm-notify.pid
# Start daemons.
# See if the kernel lockd should start up
# listening on a particular port
#
if [ -n "$LOCKD_TCPPORT" -o -n "$LOCKD_UDPPORT" ]; then
LOCKDARG=""
[ -n "$LOCKD_TCPPORT" ] && LOCKDARG="nlm_tcpport=$LOCKD_TCPPORT"
[ -n "$LOCKD_UDPPORT" ] && \
LOCKDARG="$LOCKDARG nlm_udpport=$LOCKD_UDPPORT"
[ -n "$LOCKDARG" ] && \
modprobe lockd $LOCKDARG
fi
echo -n $"Starting NFS statd: "
# See if a statd's local hostname is defined
[ -n "${STATD_HOSTNAME}" ] && STATDARG="$STATDARG -n ${STATD_HOSTNAME}"
# See if a statd's ports has been defined
[ -n "$STATD_PORT" ] && STATDARG="$STATDARG -p $STATD_PORT"
[ -n "$STATD_OUTGOING_PORT" ] \
&& STATDARG="$STATDARG -o $STATD_OUTGOING_PORT"
# See if we have an HA-callout program specified
[ -n "$STATD_HA_CALLOUT" ] \
&& STATDARG="$STATDARG -H $STATD_HA_CALLOUT"
daemon rpc.statd "$STATDARG"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nfslock
return $RETVAL
}
stop() {
# Stop daemons.
if [ -n "`pidofproc lockd`" ]; then
echo -n $"Stopping NFS locking: "
killproc lockd -KILL
echo
fi
echo -n $"Stopping NFS statd: "
killproc rpc.statd
RETVAL=0
echo
rm -f /var/lock/subsys/nfslock
rm -f /var/run/sm-notify.pid
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
if [ "$USERLAND_LOCKD" ]; then
status lockd
fi
status rpc.statd
;;
restart)
stop
start
;;
probe)
if [ ! -f /var/lock/subsys/nfslock ] ; then
echo $"start"; exit 0
fi
/sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?"
if [ "$USERLAND_LOCKD" ]; then
/sbin/pidof lockd >/dev/null 2>&1; LOCKD="$?"
else
LOCKD=0
fi
if [ $STATD = 1 -o $LOCKD = 1 ] ; then
echo $"restart"; exit 0
fi
;;
condrestart)
[ -f /var/lock/subsys/nfslock ] && {
stop
start
}
;;
*)
echo $"Usage: $0 {start|stop|status|restart|probe|condrestart}"
exit 1
esac
exit 0

View File

@ -1,104 +0,0 @@
#!/bin/bash
#
# rpcgssd Start up and shut down RPCSEC GSS daemon
#
# Authors: Chuck Lever <cel@netapp.com>
#
# chkconfig: 345 41 28
# description: Starts user-level daemon that manages RPCSEC GSS contexts \
# for the NFSv4 client.
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ ! -x /usr/sbin/rpc.gssd ] && exit 0
# Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
[ "${SECURE_NFS}" != "yes" ] && exit 0
# List of kernel modules to load
[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
# Try to use machine credentials by default
OPTIONS=""
RETVAL=0
LOCKFILE=/var/lock/subsys/rpcgssd
prog="rpc.gssd"
case "$1" in
start|condstart)
# Make sure the daemon is not already running.
if status $prog > /dev/null ; then
exit 0
fi
rm -f $LOCKFILE
echo -n $"Starting RPC gssd: "
# Load sunrpc which mounts the rpc_pipes fs.
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc || exit 1
fi
# Load rpcsec modules
for i in ${SECURE_NFS_MODS}
do
if ! /sbin/lsmod | grep $i > /dev/null ; then
/sbin/modprobe $i || exit 1
fi
done
}
# Make sure the mount worked.
[ -z "${RPCMTAB}" ] && RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
echo "Error: RPC MTAB does not exist."
exit 1
}
# Start daemon.
daemon $prog ${OPTIONS}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE
;;
stop)
# Stop daemon.
echo -n $"Shutting down RPC gssd: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
;;
status)
status rpc.gssd
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
condrestart)
if [ -f $LOCKFILE ]; then
$0 restart
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}"
exit 1
esac
exit $RETVAL

View File

@ -1,87 +0,0 @@
#!/bin/bash
#
# rpcidmapd Start up and shut down RPC name to UID/GID mapper
#
# Authors: Chuck Lever <cel@netapp.com>
#
# chkconfig: 345 40 27
# description: Starts user-level daemon for NFSv4 that maps user \
# names to UID and GID numbers.
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ ! -x /usr/sbin/rpc.idmapd ] && exit 0
OPTIONS=""
RETVAL=0
LOCKFILE=/var/lock/subsys/rpcidmapd
prog="rpc.idmapd"
case "$1" in
start|condstart)
# Make sure the daemon is not already running.
[ "$1" = "condstart" -a -n "`pidofproc $prog`" ] && {
killproc $prog "-SIGHUP" > /dev/null
exit 0
}
rm -f $LOCKFILE
echo -n $"Starting RPC idmapd: "
# mount the rpc_pipes fs.
[ -e /var/lib/nfs/rpc_pipefs/nfs ] || \
mount rpc_pipefs /var/lib/nfs/rpc_pipefs -t rpc_pipefs
# Make sure the mount worked.
[ -z "${RPCMTAB}" ] && RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
echo "Error: RPC MTAB does not exist."
exit 1
}
# Start daemon.
daemon $prog ${OPTIONS}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE
;;
stop)
# Stop daemon.
echo -n $"Shutting down RPC idmapd: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
;;
status)
status rpc.idmapd
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
condrestart)
if [ -f $LOCKFILE ]; then
$0 restart
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}"
exit 1
esac
exit $RETVAL

View File

@ -1,103 +0,0 @@
#!/bin/bash
#
# rpcsvcgssd Start up and shut down RPCSEC GSS daemon
#
# Authors: Chuck Lever <cel@netapp.com>
#
# chkconfig: - 41 28
# description: Starts user-level daemon that manages RPCSEC GSS contexts \
# for the NFSv4 server.
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
[ ! -x /usr/sbin/rpc.svcgssd ] && exit 0
# Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
[ "${SECURE_NFS}" != "yes" ] && exit 0
# List of kernel modules to load
[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
OPTIONS=""
RETVAL=0
LOCKFILE=/var/lock/subsys/rpcsvcgssd
prog="rpc.svcgssd"
case "$1" in
start|condstart)
# Make sure the daemon is not already running.
if status $prog > /dev/null ; then
exit 0
fi
rm -f $LOCKFILE
echo -n $"Starting RPC svcgssd: "
# Load sunrpc which mounts the rpc_pipes fs.
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc || exit 1
fi
# Load rpcsec modules
for i in ${SECURE_NFS_MODS}
do
if ! /sbin/lsmod | grep $i > /dev/null ; then
/sbin/modprobe $i || exit 1
fi
done
}
# Make sure the mount worked.
[ -z "${RPCMTAB}" ] && RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
echo "Error: RPC MTAB does not exist."
exit 1
}
# Start daemon.
daemon $prog ${OPTIONS}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE
;;
stop)
# Stop daemon.
echo -n $"Shutting down RPC svcgssd: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
;;
status)
status rpc.svcgssd
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
condrestart)
if [ -f $LOCKFILE ]; then
$0 restart
RETVAL=$?
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}"
exit 1
esac
exit $RETVAL

7
nfs-utils-sysconfig Normal file
View File

@ -0,0 +1,7 @@
#RPCIDMAPDARGS=""
#RPCMOUNTDARGS=""
#RPCNFSDARGS=""
#GSSDARGS=""
#SMNOTIFYARGS=""
#STATDARGS=""
#SVCGSSDARGS=""

View File

@ -8,8 +8,8 @@
%define with_mount 1 %define with_mount 1
Name: nfs-utils Name: nfs-utils
Version: 1.3.0 Version: 1.3.1
Release: 1mamba Release: 2mamba
Summary: NFS utilities and supporting clients and daemons for the kernel NFS server Summary: NFS utilities and supporting clients and daemons for the kernel NFS server
Group: Network/File Systems Group: Network/File Systems
Vendor: openmamba Vendor: openmamba
@ -18,12 +18,7 @@ Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://nfs.sourceforge.net URL: http://nfs.sourceforge.net
#Source0: http://www.kernel.org/pub/linux/utils/nfs/nfs-utils-%{version}.tar.bz2 #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 Source0: http://downloads.sourceforge.net/project/nfs/nfs-utils/%{version}/nfs-utils-%{version}.tar.bz2
Source1: nfs-utils-nfs.sysconfig Source1: nfs-utils-sysconfig
Source2: nfs-utils-nfs.init
Source3: nfs-utils-nfslock.init
Source4: nfs-utils-rpcidmapd.init
Source5: nfs-utils-rpcgssd.init
Source6: nfs-utils-rpcsvcgssd.init
Source7: nfs-utils-idmapd.conf Source7: nfs-utils-idmapd.conf
Patch0: %{name}-1.2.5-arm-PAGE_SIZE.patch Patch0: %{name}-1.2.5-arm-PAGE_SIZE.patch
License: GPL License: GPL
@ -52,33 +47,24 @@ BuildRequires: pkgconfig
BuildRequires: tcp_wrappers-devel >= 7.6 BuildRequires: tcp_wrappers-devel >= 7.6
Requires(pre): /sbin/nologin Requires(pre): /sbin/nologin
Requires: rpcbind Requires: rpcbind
%systemd_requires
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
# FIXME:
# configure: WARNING: could not locate SPKM3 header; will not have SPKM3 support
# Note for linux kernel 2.6.x :
# With 2.6 we have the option of having the kernel tell mountd when it
# gets a request from an unknown host, and mountd can give appropriate
# export information to the kernel. This removes the dependency on
# rmtab and means that the kernel only needs to know about currently
# active clients.
#
# To enable this new functionality, you need to:
#
# mount -t nfsd nfsd /proc/fs/nfs
#
# before running exportfs or mountd. It is recommended that all NFS
# services be protected from the internet-at-large by a firewall where
# that is possible.
%description %description
The nfs-utils package provides a daemon for the kernel NFS server and related tools, which provides a much higher level of performance than the traditional Linux NFS server used by most users. The nfs-utils package provides a daemon for the kernel NFS server and related tools, which provides a much higher level of performance than the traditional Linux NFS server used by most users.
This package also contains the showmount program. Showmount queries the mount daemon on a remote host for information about the NFS (Network File System) server on the remote host. For example, showmount can display the clients which are mounted on that host. This package also contains the showmount program. Showmount queries the mount daemon on a remote host for information about the NFS (Network File System) server on the remote host. For example, showmount can display the clients which are mounted on that host.
%package -n nfs-server
Group: System/Servers
Summary: NFS server and services
Requires(post):%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n nfs-server
This package contains libraries and header files for developing applications that use %{name}.
%prep %prep
%setup -q %setup -q
#%patch0 -p1 sed -i "s|/run/sysconfig|/run|" systemd/*
%build %build
# --disable-tirpc: we currently use portmap. # --disable-tirpc: we currently use portmap.
@ -106,7 +92,6 @@ This package also contains the showmount program. Showmount queries the mount d
LDFLAGS="-L%{_prefix}/%{_host}/lib -lnsl -ldl -luuid -lgssglue -lrpcsecgss" LDFLAGS="-L%{_prefix}/%{_host}/lib -lnsl -ldl -luuid -lgssglue -lrpcsecgss"
%endif %endif
#% if %{with_rquotad} #% if %{with_rquotad}
# --enable-rquotad \ # --enable-rquotad \
#% else #% else
@ -123,31 +108,36 @@ make all CC=%{_host}-gcc CFLAGS="%{optflags}" LDFLAGS="-lrpcsecgss"
%install %install
[ "%{buildroot}" != / ] && rm -rf %{buildroot} [ "%{buildroot}" != / ] && rm -rf %{buildroot}
install -d -m0755 %{buildroot}/sbin
%makeinstall statduser=$USER %makeinstall statduser=$USER
mv %{buildroot}%{_sbindir}/{start-statd,rpc.statd} %{buildroot}/sbin
install -D -m 644 %{S:1} %{buildroot}%{_sysconfdir}/sysconfig/nfs
install -D -m 755 %{S:2} %{buildroot}%{_initrddir}/nfs
install -D -m 755 %{S:3} %{buildroot}%{_initrddir}/nfslock
install -D -m 755 %{S:4} %{buildroot}%{_initrddir}/rpcidmapd
install -D -m 755 %{S:5} %{buildroot}%{_initrddir}/rpcgssd
install -D -m 755 %{S:6} %{buildroot}%{_initrddir}/rpcsvcgssd
#install -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/idmapd.conf
install -d %{buildroot}/var/lib/nfs/rpc_pipefs install -d %{buildroot}/var/lib/nfs/rpc_pipefs
install -d %{buildroot}/var/lib/nfs/statd install -d %{buildroot}/var/lib/nfs/statd
install -d %{buildroot}/var/lib/nfs/v4recovery install -d %{buildroot}/var/lib/nfs/v4recovery
touch %{buildroot}%{_sysconfdir}/exports
touch %{buildroot}/var/lib/nfs/rmtab touch %{buildroot}/var/lib/nfs/rmtab
install -d %{buildroot}%{_sysconfdir}
touch %{buildroot}%{_sysconfdir}/exports
install -d -m0755 %{buildroot}%{_unitdir}
cp -a systemd/*.service %{buildroot}%{_unitdir}
cp -a systemd/*.target %{buildroot}%{_unitdir}
cp -a systemd/*.mount %{buildroot}%{_unitdir}
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
%pre %pre
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
chkconfig nfs off 2>/dev/null || true
rm -f /etc/rc*.d/S55nfs
chkconfig nfslock off 2>/dev/null || true
/usr/sbin/groupadd -g %{rpcuser_gid} rpcuser 2>/dev/null /usr/sbin/groupadd -g %{rpcuser_gid} rpcuser 2>/dev/null
/usr/sbin/useradd -c "RPC Service User" \ /usr/sbin/useradd -c "RPC Service User" \
-s /bin/false -u %{rpcuser_uid} -g rpcuser -d /var/lib/nfs rpcuser 2>/dev/null -s /bin/false -u %{rpcuser_uid} -g rpcuser -d /var/lib/nfs rpcuser 2>/dev/null
@ -155,88 +145,71 @@ if [ $1 -ge 1 ]; then
/usr/sbin/useradd -c nobody -u %{nobodyuserid} -d /dev/null -g nobody \ /usr/sbin/useradd -c nobody -u %{nobodyuserid} -d /dev/null -g nobody \
-s /bin/false nobody 2>/dev/null -s /bin/false nobody 2>/dev/null
fi fi
exit 0 :
%post
if [ $1 -ge 1 ]; then
#/sbin/chkconfig --add nfs
/sbin/chkconfig --del nfslock
#/sbin/chkconfig --add rpcidmapd
#/sbin/chkconfig --add rpcgssd
#/sbin/chkconfig --add rpcsvcgssd
fi
exit 0
%postun
if [ $1 -ge 1 ]; then
for daemon in rpcidmapd rpcgssd nfs; do
service $daemon condrestart >/dev/null
done
fi
exit 0
%preun %preun
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
for daemon in nfs rpcidmapd rpcgssd rpcsvcgssd nfslock; do
service $daemon stop 2>/dev/null
/sbin/chkconfig --del $daemon
done
/usr/sbin/userdel rpcuser 2>/dev/null /usr/sbin/userdel rpcuser 2>/dev/null
/usr/sbin/groupdel rpcuser 2>/dev/null /usr/sbin/groupdel rpcuser 2>/dev/null
rm -rf /var/lib/nfs/statd/* rm -rf /var/lib/nfs/statd/*
rm -rf /var/lib/nfs/v4recovery/* rm -rf /var/lib/nfs/v4recovery/*
fi fi
exit 0 :
%post -n nfs-server
%systemd_post nfs-server
:
%preun -n nfs-server
%systemd_preun nfs-server
:
%postun -n nfs-server
%systemd_postun_with_restart nfs-server
:
%posttrans -n nfs-server
[ ! -e /etc/exportfs -a -e /etc/exportfs.rpmsave ] && \
mv /etc/exportfs.rpmsave /etc/exportfs
:
%clean %clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot} [ "%{buildroot}" != / ] && rm -rf %{buildroot}
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/sysconfig/nfs
%if %{with_mount} %if %{with_mount}
%attr(4755,root,root) /sbin/mount.nfs %attr(4755,root,root) /sbin/mount.nfs
%attr(4755,root,root) /sbin/mount.nfs4 %attr(4755,root,root) /sbin/mount.nfs4
%attr(4755,root,root) /sbin/umount.nfs %attr(4755,root,root) /sbin/umount.nfs
%attr(4755,root,root) /sbin/umount.nfs4 %attr(4755,root,root) /sbin/umount.nfs4
%endif %endif
/sbin/nfsdcltrack
/sbin/osd_login /sbin/osd_login
/sbin/start-statd
/sbin/rpc.statd
%{_sbindir}/blkmapd %{_sbindir}/blkmapd
%{_sbindir}/exportfs
%{_sbindir}/mountstats %{_sbindir}/mountstats
%{_sbindir}/nfsdcltrack
%{_sbindir}/nfsidmap %{_sbindir}/nfsidmap
%{_sbindir}/nfsiostat %{_sbindir}/nfsiostat
%{_sbindir}/nfsstat
%{_sbindir}/rpcdebug
%{_sbindir}/rpc.idmapd
%if "%{stage1}" != "1" %if "%{stage1}" != "1"
#%{_sbindir}/gss_clnt_send_err
#%{_sbindir}/gss_destroy_creds
%{_sbindir}/rpc.gssd %{_sbindir}/rpc.gssd
%{_sbindir}/rpc.svcgssd %{_sbindir}/rpc.svcgssd
%endif %endif
%{_sbindir}/nfsstat
#%{_sbindir}/nhfsgraph
#%{_sbindir}/nhfsnums
#%{_sbindir}/nhfsrun
#%{_sbindir}/nhfsstone
%{_sbindir}/rpcdebug
%{_sbindir}/rpc.idmapd
%{_sbindir}/rpc.mountd
%{_sbindir}/rpc.nfsd
#%if %{with_rquotad} #%if %{with_rquotad}
#%{_sbindir}/rpc.rquotad #%{_sbindir}/rpc.rquotad
#%endif #%endif
%{_sbindir}/showmount %{_sbindir}/rpc.statd
%{_sbindir}/sm-notify %{_sbindir}/sm-notify
%{_initrddir}/nfs %{_sbindir}/showmount
%{_initrddir}/nfslock %{_unitdir}/nfs-client.target
%{_initrddir}/rpcidmapd %{_unitdir}/nfs-utils.service
%{_initrddir}/rpcgssd %{_unitdir}/rpc-gssd.service
%{_initrddir}/rpcsvcgssd %{_unitdir}/rpc-statd-notify.service
%config(noreplace) %{_sysconfdir}/exports %{_prefix}/lib/systemd/scripts/nfs-utils_env.sh
#%config(noreplace) %{_sysconfdir}/idmapd.conf %dir %attr(-,rpcuser,rpcuser) /var/lib/nfs
%config(noreplace) %{_sysconfdir}/sysconfig/nfs
%dir /var/lib/nfs
%dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd %dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd
%dir /var/lib/nfs/v4recovery %dir /var/lib/nfs/v4recovery
%dir /var/lib/nfs/rpc_pipefs %dir /var/lib/nfs/rpc_pipefs
@ -246,14 +219,64 @@ exit 0
%config(noreplace) /var/lib/nfs/rmtab %config(noreplace) /var/lib/nfs/rmtab
%config(noreplace) /var/lib/nfs/state %config(noreplace) /var/lib/nfs/state
%config(noreplace) /var/lib/nfs/xtab %config(noreplace) /var/lib/nfs/xtab
%{_mandir}/man5/exports.5*
#%exclude %{_mandir}/man5/idmapd.conf.5*
%{_mandir}/man5/nfs.5* %{_mandir}/man5/nfs.5*
%{_mandir}/man8/blkmapd.8*
%{_mandir}/man8/gssd.8*
%{_mandir}/man8/idmapd.8*
%{_mandir}/man8/mount.nfs.8*
%{_mandir}/man8/mountstats.8*
%{_mandir}/man8/nfsdcltrack.8*
%{_mandir}/man8/nfsidmap.8*
%{_mandir}/man8/nfsiostat.8*
%{_mandir}/man8/nfsstat.8*
%{_mandir}/man8/rpc.gssd.8*
%{_mandir}/man8/rpc.idmapd.8*
%{_mandir}/man8/rpcdebug.8*
%{_mandir}/man8/showmount.8*
%{_mandir}/man8/sm-notify.8*
%{_mandir}/man8/statd.8*
%{_mandir}/man8/svcgssd.8*
%{_mandir}/man8/umount.nfs.8*
%doc COPYING
#linux-nfs/*
%files -n nfs-server
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/exports
%{_sbindir}/start-statd
%{_sbindir}/exportfs
%{_sbindir}/rpc.mountd
%{_sbindir}/rpc.nfsd
%{_unitdir}/auth-rpcgss-module.service
%{_unitdir}/nfs-blkmap.service
%{_unitdir}/nfs-blkmap.target
%{_unitdir}/nfs-config.service
%{_unitdir}/nfs-idmapd.service
%{_unitdir}/nfs-mountd.service
%{_unitdir}/nfs-server.service
%{_unitdir}/proc-fs-nfsd.mount
%{_unitdir}/rpc-statd.service
%{_unitdir}/rpc-svcgssd.service
%{_unitdir}/var-lib-nfs-rpc_pipefs.mount
%{_mandir}/man5/exports.5*
%{_mandir}/man8/exportfs.8*
%{_mandir}/man8/mountd.8*
%{_mandir}/man8/nfsd.8*
%{_mandir}/man8/rpc.mountd.8*
%{_mandir}/man8/rpc.nfsd.8*
%{_mandir}/man8/rpc.sm-notify.8*
%{_mandir}/man8/rpc.statd.8*
%{_mandir}/man8/rpc.svcgssd.8*
%{_mandir}/man7/nfsd.7* %{_mandir}/man7/nfsd.7*
%{_mandir}/man8/*
%doc COPYING linux-nfs/*
%changelog %changelog
* Wed Oct 01 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.1-2mamba
- provide nfs-utils_env.sh script and /etc/sysconfig/nfs
* Tue Sep 30 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.1-1mamba
- update to 1.3.1
- systemd support and added nfs-server package
* Fri Jun 27 2014 Automatic Build System <autodist@mambasoft.it> 1.3.0-1mamba * Fri Jun 27 2014 Automatic Build System <autodist@mambasoft.it> 1.3.0-1mamba
- automatic version update by autodist - automatic version update by autodist