#!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/rpc.statd.initd,v 1.3 2007/05/12 11:27:06 vapier Exp $ [ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs rpc_bin=/sbin/rpc.statd rpc_pid=/var/run/rpc.statd.pid depend() { use ypbind net need portmap after quota } mount_nfsd() { # Make sure nfs support is loaded in the kernel #64709 if [ -e /proc/modules ] && ! grep -qs nfsd /proc/filesystems ; then modprobe nfsd &> /dev/null fi # This is the new "kernel 2.6 way" to handle the exports file if grep -qs nfsd /proc/filesystems ; then if ! grep -qs "nfsd /proc/fs/nfs" /proc/mounts ; then ebegin "Mounting nfsd filesystem in /proc" mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfs eend $? fi fi } is_running() { # Don't start rpc.statd if already started by someone else ... # Don't try and kill it if it's already dead ... killall -0 rpc.statd 2>/dev/null } start() { mount_nfsd is_running && return 0 ebegin "Starting NFS statd" start-stop-daemon --start --quiet --exec ${rpc_bin} -- ${OPTS_RPC_STATD} eend $? } stop() { is_running || return 1 ebegin "Stopping NFS statd" start-stop-daemon --stop --quiet --exec ${rpc_bin} --pidfile /var/run/rpc.statd.pid eend $? }