#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfsmount,v 1.7 2006/06/28 03:28:58 vapier Exp $ depend() { need net portmap use ypbind } 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 }