Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Thomas Orgis (1d396538e402b0ad77daebd8580c06c348a708df)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Thomas Orgis <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Thomas Orgis (1d396538e402b0ad77daebd8580c06c348a708df)
  • Date: Sat, 18 Nov 2006 23:23:06 -0600

GIT changes to master grimoire by Thomas Orgis <sobukus AT sourcemage.org>:

net/nfs-utils/CONFIGURE | 6 ++-
net/nfs-utils/DETAILS | 1
net/nfs-utils/HISTORY | 7 ++++
net/nfs-utils/init.d/nfs | 72
++++++++++++++++++++++++++++++++++---------
net/nfs-utils/init.d/nfslock | 28 +++++++++++++++-
5 files changed, 96 insertions(+), 18 deletions(-)

New commits:
commit 1d396538e402b0ad77daebd8580c06c348a708df
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>

cleanup of nfs init scripts, also now not only redundant but independent,
too (one for client only and one for full server)

diff --git a/net/nfs-utils/CONFIGURE b/net/nfs-utils/CONFIGURE
index ae972b9..f59ff7b 100755
--- a/net/nfs-utils/CONFIGURE
+++ b/net/nfs-utils/CONFIGURE
@@ -1,2 +1,6 @@
config_query_option NFS_UTILS_NFSV3 "Enable NFSv3 support?" y \
- "--enable-nfsv3" "--disable-nfsv3"
+ "--enable-nfsv3" "--disable-nfsv3" &&
+message "Please note that you need only one of the init scripts:" &&
+message "nfs - full NFS server and client support" &&
+message "nfslock - only locking services for client"
+
diff --git a/net/nfs-utils/DETAILS b/net/nfs-utils/DETAILS
index c7a7e51..af98589 100755
--- a/net/nfs-utils/DETAILS
+++ b/net/nfs-utils/DETAILS
@@ -7,6 +7,7 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL
WEB_SITE=http://nfs.sourceforge.net/
ENTERED=20011023
LICENSE[0]=GPL
+ PATCHLEVEL=1
KEYWORDS="net"
SHORT="NFS is The Network File System"
cat << EOF
diff --git a/net/nfs-utils/HISTORY b/net/nfs-utils/HISTORY
index d6addb0..a79c4bb 100644
--- a/net/nfs-utils/HISTORY
+++ b/net/nfs-utils/HISTORY
@@ -1,3 +1,10 @@
+2006-11-19 Thomas Orgis <sobukus AT sourcemage.org>
+ * init.d/nfs, init.d/nfslock, CONFIGURE: cleaned and completed
(status())
+ init scripts, made them independent:
+ - nfs for full client & server
+ - nfslock for just client (for locking, for mounting portmap is
enough)
+ * DETAILS: added a PATCHLEVEL for that
+
2006-07-10 Flavien Bridault <vlaaad AT sourcemage.org>
* DETAILS: Updated to 1.0.9, removed BUILD_API=2
* PRE_BUILD, gcc4.1.patch: removed, compiles fine now
diff --git a/net/nfs-utils/init.d/nfs b/net/nfs-utils/init.d/nfs
index 8d3ccd5..113ea13 100644
--- a/net/nfs-utils/init.d/nfs
+++ b/net/nfs-utils/init.d/nfs
@@ -14,32 +14,74 @@ if [ ! -e /etc/exports ] ; then
exit 1
fi

+# may be outsourced
+get_kernel_pids()
+{
+ local rval=1
+ for pid in $(pidof $1)
+ do
+ if [[ -z $(</proc/$pid/cmdline) ]]; then
+ builtin echo $pid
+ rval=0
+ fi
+ done
+ return $rval
+}
+
start()
{
+ echo "Starting full NFS services (server & locking)"
+ # why do we reexport before the daemons are up?
+ # doesn't seem to matter much
required_executable /usr/sbin/exportfs
- required_executable /usr/sbin/rpc.rquotad
- required_executable /usr/sbin/rpc.mountd
- required_executable /usr/sbin/rpc.nfsd
- required_executable /usr/sbin/rpc.statd
-
- echo "Starting NFS services"
+ echo -n "exportfs"
/usr/sbin/exportfs -r
evaluate_retval

- loadproc /usr/sbin/rpc.rquotad
- loadproc /usr/sbin/rpc.mountd $MOUNTDOPTS
- loadproc /usr/sbin/rpc.nfsd $NUMSERVERS
- loadproc /usr/sbin/rpc.statd
+ # nfs-howto says: these daemons in this order
+ # userspace does not bother about lockd since linux 2.2.18
+ for d in mountd nfsd statd rquotad
+ do
+ required_executable /usr/sbin/rpc.$d
+ local opts=
+ if [[ $d == mountd ]]; then opts="$MOUNTDOPTS"
+ elif [[ $d == nfsd ]]; then opts="$NUMSERVERS"
+ fi
+ echo -n $d
+ loadproc /usr/sbin/rpc.$d $opts
+ done
}

stop()
{
echo "Stopping NFS services"
+ echo -n "unexporting filesystems"
/usr/sbin/exportfs -au
evaluate_retval
-
- killproc /usr/sbin/rpc.rquotad
- killproc /usr/sbin/rpc.mountd
- killproc /usr/sbin/rpc.nfsd
- killproc /usr/sbin/rpc.statd
+
+ # all in one loop to simplify code, reversed order
+ # atm. only nfsd is really in-kernel (and lockd self-managed)
+ for d in rquotad statd nfsd mountd
+ do
+ local kpid=$(get_kernel_pids $d)
+ if [[ -z $kpid ]]; then
+ echo -n "killing $d"
+ killproc /usr/sbin/rpc.$d
+ else
+ echo "not killing kernel $d (PID $kpid)"
+ fi
+ done
+}
+
+status()
+{
+ for d in mountd nfsd statd rquotad
+ do
+ local kpid=$(get_kernel_pids $d)
+ [[ -n $kpid ]] && echo "kernel $d there with PIDs $kpid" ||
+ statusproc /usr/sbin/rpc.$d
+ done
+ echo -n "kernel lockd "
+ kpid=$(get_kernel_pids lockd)
+ [[ -n $kpid ]] && echo "is active (PID $kpid)" || echo "is not active (but
hopefully ready)"
}
diff --git a/net/nfs-utils/init.d/nfslock b/net/nfs-utils/init.d/nfslock
index 649d3f9..2f46cd1 100644
--- a/net/nfs-utils/init.d/nfslock
+++ b/net/nfs-utils/init.d/nfslock
@@ -2,16 +2,31 @@

PROGRAM=/bin/false
RUNLEVEL=3
-NEEDS="+remote_fs +network +portmap nfs"
+NEEDS="+remote_fs +network +portmap"

. /etc/init.d/smgl_init

+# may be outsourced
+get_kernel_pids()
+{
+ local rval=1
+ for pid in $(pidof $1)
+ do
+ if [[ -z $(</proc/$pid/cmdline) ]]; then
+ builtin echo $pid
+ rval=0
+ fi
+ done
+ return $rval
+}
+
start()
{
required_executable /usr/sbin/rpc.statd

- echo "Starting NFS file locking services, rpc.statd"
+ echo "Starting NFS file locking services (for client)"
loadproc /usr/sbin/rpc.statd
+ # rpc.lockd is automatic for linux >= 2.2.18
}

stop()
@@ -19,3 +34,12 @@ stop()
echo "Stopping NFS file locking services"
killproc /usr/sbin/rpc.statd
}
+
+status()
+{
+ statusproc /usr/sbin/rpc.statd
+ # kernel lockd shows itself only when actually at work
+ echo -n "kernel lockd "
+ kpid=$(get_kernel_pids lockd)
+ [[ -n $kpid ]] && echo "is active (PID $kpid)" || echo "is not active (but
hopefully ready)"
+}



  • [SM-Commit] GIT changes to master grimoire by Thomas Orgis (1d396538e402b0ad77daebd8580c06c348a708df), Thomas Orgis, 11/19/2006

Archive powered by MHonArc 2.6.24.

Top of Page