summaryrefslogtreecommitdiff
path: root/net-fs
diff options
context:
space:
mode:
authorAron Griffis <agriffis@gentoo.org>2001-08-29 16:07:46 +0000
committerAron Griffis <agriffis@gentoo.org>2001-08-29 16:07:46 +0000
commit9a324b05f69c09e1b4f8e28aedfd46f87a79629b (patch)
tree927a8505e17c8d545892f3e46e6b8d6506814311 /net-fs
parentdigest and new news item (diff)
downloadhistorical-9a324b05f69c09e1b4f8e28aedfd46f87a79629b.tar.gz
historical-9a324b05f69c09e1b4f8e28aedfd46f87a79629b.tar.bz2
historical-9a324b05f69c09e1b4f8e28aedfd46f87a79629b.zip
Updated to 0.3.1. Also overhauled both the ebuild and the init
scripts. The init scripts are now split into init.d/nfs and init.d/nfsmount, which properly separates server from client functionality.
Diffstat (limited to 'net-fs')
-rw-r--r--net-fs/nfs-utils/files/digest-nfs-utils-0.3.1-r11
-rw-r--r--net-fs/nfs-utils/files/exports-0.3.1-r11
-rw-r--r--net-fs/nfs-utils/files/nfs-0.3.1-r1127
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-0.3.1-r1-gentoo.diff11
-rw-r--r--net-fs/nfs-utils/files/nfsmount-0.3.1-r147
-rw-r--r--net-fs/nfs-utils/nfs-utils-0.3.1-r1.ebuild79
6 files changed, 266 insertions, 0 deletions
diff --git a/net-fs/nfs-utils/files/digest-nfs-utils-0.3.1-r1 b/net-fs/nfs-utils/files/digest-nfs-utils-0.3.1-r1
new file mode 100644
index 000000000000..d20ba330f224
--- /dev/null
+++ b/net-fs/nfs-utils/files/digest-nfs-utils-0.3.1-r1
@@ -0,0 +1 @@
+MD5 7acac2d055067d48bf5bc4b4d0fc630f nfs-utils-0.3.1.tar.gz
diff --git a/net-fs/nfs-utils/files/exports-0.3.1-r1 b/net-fs/nfs-utils/files/exports-0.3.1-r1
new file mode 100644
index 000000000000..5102ef27c150
--- /dev/null
+++ b/net-fs/nfs-utils/files/exports-0.3.1-r1
@@ -0,0 +1 @@
+# /etc/exports: NFS file systems being exported. See exports(5).
diff --git a/net-fs/nfs-utils/files/nfs-0.3.1-r1 b/net-fs/nfs-utils/files/nfs-0.3.1-r1
new file mode 100644
index 000000000000..48e359fc0e5e
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-0.3.1-r1
@@ -0,0 +1,127 @@
+#!/bin/sh
+#RCUPDATE:3 4:74:This line is required for script management
+
+#---------------------------------------------------------------------------
+# This script starts/stops the following
+# rpc.statd if necessary (also checked by init.d/nfsmount)
+# rpd.rquotad
+# rpd.nfsd
+# rpc.mountd
+#
+# (17 Aug 2001 agriffis)
+#---------------------------------------------------------------------------
+
+# These can be overridden in /etc/rc.d/config/basic if desired
+RPCNFSDCOUNT=8 # Number of servers to be started up by default
+RPCMOUNTDOPTS=
+
+. /etc/rc.d/config/functions
+. /etc/rc.d/config/basic
+
+# This variable is used for controlling whether or not to run exportfs -ua;
+# see stop() for more information
+RESTARTING=no
+
+opts="start stop restart reload"
+
+start_statd() {
+ # Don't start rpc.statd if already started by init.d/nfsmount
+ killall -0 rpc.statd &>/dev/null && return 0
+ ebegin "Starting NFS statd"
+ start-stop-daemon --start --quiet --exec /sbin/rpc.statd 1>&2
+ eend $? "Error starting NFS statd"
+}
+
+stop_statd() {
+ # Don't stop rpc.statd if it's in use by init.d/nfsmount.
+ mount -t nfs | grep -q . && return 0
+ # Make sure it's actually running
+ killall -0 rpc.statd &>/dev/null || return 0
+ # Okay, all tests passed, stop rpc.statd
+ ebegin "Stopping NFS statd"
+ start-stop-daemon --stop --quiet --exec /sbin/rpc.statd 1>&2
+ eend $? "Error stopping NFS statd"
+}
+
+start() {
+ if [ "$NFSSERVER" = "yes" ]
+ then
+ start_statd
+
+ if grep -q '^/' /etc/exports &>/dev/null; then
+ ebegin "Exporting NFS directories"
+ /sbin/exportfs -r 1>&2
+ eend $? "Error exporting NFS directories"
+ fi
+
+ ebegin "Starting NFS rquotad"
+ start-stop-daemon --start --quiet --exec /sbin/rpc.rquotad 1>&2
+ eend $? "Error starting NFS rquotad"
+
+ ebegin "Starting NFS daemon"
+ start-stop-daemon --start --quiet --exec \
+ /sbin/rpc.nfsd -- $RPCNFSDCOUNT 1>&2
+ eend $? "Error starting NFS daemon"
+
+ # Check if we support NFSv3
+ ebegin "Starting NFS mountd"
+ rpcinfo -u localhost nfs 3 &>/dev/null || \
+ RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3"
+ start-stop-daemon --start --quiet --exec \
+ /sbin/rpc.mountd -- $RPCMOUNTDOPTS 1>&2
+ eend $? "Error starting NFS mountd"
+ fi
+}
+
+stop() {
+ # Don't check NFSSERVER variable since it might have changed,
+ # instead use --oknodo to smooth things over
+ ebegin "Stopping NFS mountd"
+ start-stop-daemon --stop --quiet --oknodo \
+ --exec /sbin/rpc.mountd 1>&2
+ eend $? "Error stopping NFS mountd"
+
+ ebegin "Stopping NFS daemon"
+ start-stop-daemon --stop --quiet --oknodo \
+ --name nfsd --user root --signal 2 1>&2
+ eend $? "Error stopping NFS daemon"
+
+ ebegin "Stopping NFS rquotad"
+ start-stop-daemon --stop --quiet --oknodo \
+ --exec /sbin/rpc.rquotad 1>&2
+ eend $? "Error stopping NFS rquotad"
+
+ # When simply restarting the NFS server, running "exportfs -ua"
+ # probably isn't what the user wants. Running it causes all
+ # entries listed in xtab to be removed from the kernel export
+ # tables, and the xtab file is cleared. This effectively shuts
+ # down all NFS activity, leaving all clients holding stale NFS
+ # filehandles, /even/ when the NFS server has restarted.
+ #
+ # This is what you would want if you were shutting down the NFS
+ # server for good, or for a long period of time, but not when the
+ # NFS server will be running again in short order. In this case,
+ # then "exportfs -r" will reread the xtab, and all the current
+ # clients will be able to resume NFS activity, /without/ needing
+ # to umount/(re)mount the filesystem.
+ if [ "$RESTARTING" = no ]; then
+ ebegin "Unexporting NFS directories"
+ /sbin/exportfs -ua 1>&2
+ eend $? "Error unexporting NFS directories"
+ fi
+
+ stop_statd
+}
+
+reload() {
+ /sbin/exportfs -r
+}
+
+restart() {
+ # See comment in stop() regarding exportfs -ua
+ RESTARTING=yes
+ stop
+ start
+}
+
+doservice "${@}"
diff --git a/net-fs/nfs-utils/files/nfs-utils-0.3.1-r1-gentoo.diff b/net-fs/nfs-utils/files/nfs-utils-0.3.1-r1-gentoo.diff
new file mode 100644
index 000000000000..2265f309bb14
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils-0.3.1-r1-gentoo.diff
@@ -0,0 +1,11 @@
+--- nfs-utils-0.2.1/support/nfs/rpcmisc.c~ Sun Apr 30 06:14:56 2000
++++ nfs-utils-0.2.1/support/nfs/rpcmisc.c Mon Apr 23 17:20:51 2001
+@@ -13,7 +13,7 @@
+ */
+
+ #include "config.h"
+-
++#include <time.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
diff --git a/net-fs/nfs-utils/files/nfsmount-0.3.1-r1 b/net-fs/nfs-utils/files/nfsmount-0.3.1-r1
new file mode 100644
index 000000000000..5e552ee6020a
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfsmount-0.3.1-r1
@@ -0,0 +1,47 @@
+#!/bin/sh
+#RCUPDATE:3 4:74:This line is required for script management
+
+. /etc/rc.d/config/functions
+. /etc/rc.d/config/basic
+
+opts="start stop restart"
+
+start_statd() {
+ # Don't start rpc.statd if already started by init.d/nfs
+ killall -0 rpc.statd &>/dev/null && return 0
+ ebegin "Starting NFS statd"
+ start-stop-daemon --start --quiet --exec /sbin/rpc.statd 1>&2
+ eend $? "Error starting NFS statd"
+}
+
+stop_statd() {
+ # Don't stop rpc.statd if it's in use by init.d/nfs
+ killall -0 nfsd &>/dev/null && return 0
+ # Make sure it's actually running
+ killall -0 rpc.statd &>/dev/null || return 0
+ # Okay, all tests passed, stop rpc.statd
+ ebegin "Stopping NFS statd"
+ start-stop-daemon --stop --quiet --exec /sbin/rpc.statd 1>&2
+ eend $? "Error stopping NFS statd"
+}
+
+start() {
+ start_statd
+ ebegin "Mounting NFS filesystems"
+ mount -a -t nfs
+ eend $? "Error mounting NFS filesystems"
+}
+
+stop() {
+ ebegin "Unmounting NFS filesystems"
+ umount -a -t nfs
+ eend $? "Error unmounting NFS filesystems"
+ stop_statd
+}
+
+restart() {
+ stop
+ start
+}
+
+doservice "${@}"
diff --git a/net-fs/nfs-utils/nfs-utils-0.3.1-r1.ebuild b/net-fs/nfs-utils/nfs-utils-0.3.1-r1.ebuild
new file mode 100644
index 000000000000..d24b84297728
--- /dev/null
+++ b/net-fs/nfs-utils/nfs-utils-0.3.1-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Originally written by Achim Gottinger <achim@gentoo.org>
+# Heavily updated for nfs-utils-0.3.1 by Aron Griffis <agriffis@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/nfs-utils-0.3.1-r1.ebuild,v 1.1 2001/08/29 16:07:46 agriffis Exp $
+
+A=$P.tar.gz
+S=$WORKDIR/$P
+DESCRIPTION="kernel NFS daemons"
+SRC_URI="http://download.sourceforge.net/nfs/$A"
+HOMEPAGE="http://nfs.sourceforge.net/"
+
+DEPEND="virtual/glibc
+ tcpd? ( sys-apps/tcp-wrappers )"
+
+RDEPEND="virtual/glibc net-nds/portmap"
+
+src_unpack() {
+ cd $WORKDIR
+ unpack $A || die
+ cd $S || die
+ patch -p1 < $FILESDIR/$PF-gentoo.diff || die
+}
+
+src_compile() {
+ ./configure \
+ --prefix=/ \
+ --mandir=/usr/share/man \
+ --with-statedir=/var/lib/nfs \
+ --enable-nfsv3 || die
+ if ! use tcpd; then
+ cp config.mk config.mk.orig
+ sed -e "s:-lwrap::" -e "s:-DHAVE_TCP_WRAPPER::" \
+ config.mk.orig > config.mk
+ fi
+ make || die
+}
+
+src_install() {
+ # MANDIR doesn't pick up install_prefix
+ make install install_prefix=$D MANDIR=$D/usr/share/man || die
+ mkdir -p $D/etc/rc.d/init.d
+ install -m 755 $FILESDIR/nfs-$PVR $D/etc/rc.d/init.d/nfs || die
+ install -m 755 $FILESDIR/nfsmount-$PVR $D/etc/rc.d/init.d/nfsmount || die
+ install -m 644 $FILESDIR/exports-$PVR $D/etc/exports || die
+ dodoc ChangeLog COPYING README
+ docinto linux-nfs
+ dodoc linux-nfs/*
+}
+
+pkg_postinst() {
+ . $ROOT/etc/rc.d/config/functions
+ . $ROOT/var/db/pkg/install.config
+ echo "Generating symlinks..."
+ $ROOT/usr/sbin/rc-update add nfs
+ $ROOT/usr/sbin/rc-update add nfsmount
+ return 0
+}
+
+# On Red Hat, this would be the appropriate approach. $1 would be
+# tested to determine how many instances of this ebuild will be
+# installed at the end of this procedure. If $1==0, then remove the
+# symlinks.
+#
+# But this isn't Red Hat, and there's no (official) way to determine
+# the answer to this question. So instead we'll just leave the dead
+# links hanging around until the new dependency-based init.d system is
+# in place...
+#
+# pkg_prerm() {
+# . $ROOT/etc/rc.d/config/functions
+# . $ROOT/var/db/pkg/install.config
+#
+# echo "Removing symlinks..."
+# $ROOT/usr/sbin/rc-update del nfs
+# $ROOT/usr/sbin/rc-update del nfsmount
+#
+# return 0
+# }