nfs-utils: update to 1.1.6. Switch to OpenRC.

--HG--
extra : convert_revision : 6d18e9b669179e8561b46197274940fe63224213
This commit is contained in:
Juan RP 2009-05-11 04:06:34 +02:00
parent aaded2a8c6
commit 37ac64d01b
8 changed files with 71 additions and 111 deletions

View File

@ -0,0 +1,6 @@
# /etc/exports
#
# See exports(5) for more information.
#
# Use exportfs -r to reread
# /export 192.168.1.10(rw,no_root_squash)

View File

@ -1,21 +0,0 @@
#!/bin/sh
#
# PROVIDE: mountd
# REQUIRE: portmap nfslock
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="mountd"
rcvar=$name
command="/usr/sbin/rpc.mountd"
procname=${command}
start_precmd="mountd_precmd"
mountd_precmd()
{
/usr/sbin/exportfs -r
}
load_rc_config $name
run_rc_command "$1"

View File

@ -0,0 +1,13 @@
#!/sbin/runscript
# Disable v1 and v2 by default.
: ${mountd_args:=--no-nfs-version 1 --no-nfs-version 2}
command=/usr/sbin/rpc.mountd
command_args=$mountd_args
name="RPC Mountd daemon"
depend()
{
need nfslock
}

View File

@ -1,70 +0,0 @@
#!/bin/sh
#
# PROVIDE: nfsd
# REQUIRE: mountd
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="nfsd"
rcvar=$name
command="/usr/sbin/rpc.nfsd"
start_cmd="nfsd_start_cmd"
stop_cmd="nfsd_stop_cmd"
status_cmd="nfsd_status_cmd"
pidfile="/var/run/${name}.pid"
nfsd_start_cmd()
{
#
# Load the nfsd module to make the mount call
# succeed.
#
modprobe -q nfsd
#
# By default start up 8 threads.
#
[ -z "${nfsd_flags}" ] && nfsd_flags="8"
# Check for /proc/fs/nfsd
if grep -qs nfsd /proc/filesystems ; then
if ! grep -qs "nfsd /proc/fs/nfsd" /proc/mounts ; then
mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfsd
fi
fi
${command} ${nfsd_flags}
echo $(pidof -o %PPID ${name}) > ${pidfile}
echo "Starting ${name}."
/usr/sbin/sm-notify ${smnotify_args}
}
nfsd_stop_cmd()
{
#
# Unexport all directories before.
#
exportfs -au
if [ -f ${pidfile} ]; then
PID=$(cat ${pidfile})
kill ${PID}
rm -f ${pidfile}
fi
echo "Stopped ${name}."
}
nfsd_status_cmd()
{
if [ ! -f ${pidfile} ]; then
echo "${name} is not running."
return 0
fi
PID=$(cat ${pidfile})
echo "${name} is running with PIDs: ${PID}"
}
load_rc_config $name
run_rc_command "$1"

View File

@ -0,0 +1,30 @@
#!/sbin/runscript
# By default start up 8 server threads.
: ${nfsd_args:=8}
command=/usr/sbin/rpc.nfsd
command_args=$nfsd_args
pidfile=/var/run/nfsd.pid
name="RPC Network File System daemon"
depend()
{
use procfs
need mountd
}
start_post()
{
echo $(pidof -o %PPID nfsd) > $pidfile
sm-notify ${smnotify_args}
}
stop()
{
# Unexport all directories before.
exportfs -au
ebegin "Stopping $name"
kill -9 $(cat $pidfile) && rm -f $pidfile
eend $?
}

View File

@ -1,15 +0,0 @@
#!/bin/sh
#
# PROVIDE: nfslock
# REQUIRE: portmap
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="nfslock"
rcvar=$name
command="/usr/sbin/rpc.statd"
pidfile="/var/run/rpc.statd.pid"
load_rc_config $name
run_rc_command "$1"

View File

@ -0,0 +1,11 @@
#!/sbin/runscript
command=/usr/sbin/rpc.statd
command_args=$nfslock_args
pidfile=/var/run/rpc.statd.pid
name="RPC Statd daemon"
depend()
{
need portmap
}

View File

@ -1,30 +1,36 @@
# Template file for 'nfs-utils'
pkgname=nfs-utils
version=1.1.5
revision=1
version=1.1.6
distfiles="http://downloads.sf.net/nfs/$pkgname-$version.tar.bz2"
build_style=gnu_configure
configure_args="--with-statduser=nobody --disable-gss --disable-nfsv4
--enable-nfsv3 --with-statedir=/var/lib/nfs --enable-mount"
short_desc="Network File System utilities"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=9a5da7cd85dc9087222ab348ce82577c38547177d5d4dc7fccc9e939c97d47dc
checksum=9c7b4ba94cad4751604c31b9e428b0233b944fcb8ba89eebbd50e78cff73a5d5
long_desc="
The $pkgname 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."
openrc_services="mountd default nfsd default nfslock default"
triggers="openrc-service"
conf_files="/etc/exports"
Add_dependency full glibc
Add_dependency full portmap
Add_dependency build e2fsprogs
Add_dependency build tcp_wrappers
Add_dependency run e2fsprogs-libs
Add_dependency run tcp_wrappers-libs
Add_dependency run OpenRC
post_install()
{
# Install the rc.d scripts.
# Install the OpenRC services.
for f in mountd nfsd nfslock; do
install -D -m755 ${FILESDIR}/${f} ${DESTDIR}/etc/rc.d/${f}
install -D -m755 ${FILESDIR}/${f}.rc ${DESTDIR}/etc/init.d/${f}
done
install -D -m644 ${FILESDIR}/exports ${DESTDIR}/etc/exports
}