#!/sbin/openrc-run # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 #--------------------------------------------------------------------------- # This script starts/stops nfsd and mountd # Daemons rpc.rquotad, rpc.rstatd, rpc.rusersd, rpc.rwalld and rpc.sprayd # should be started from inetd on FreeBSD. #--------------------------------------------------------------------------- extra_started_commands="reload" # The binary locations nfsd=/usr/sbin/nfsd mountd=/usr/sbin/mountd depend() { use ypbind net rpc.lockd need rpcbind after quota } start() { ebegin "Starting NFS daemon" start-stop-daemon --start --quiet --exec \ $nfsd -- ${nfsdopts} eend $? "Error starting NFS daemon" # Start mountd ebegin "Starting NFS mountd" start-stop-daemon --start --quiet --exec \ $mountd -- ${mountdopts} ${exportsfile} eend $? "Error starting NFS mountd" } stop() { ebegin "Stopping NFS mountd" start-stop-daemon --stop --quiet --exec $mountd \ --pidfile /var/run/mountd.pid eend $? "Error stopping NFS mountd" ebegin "Stopping NFS daemon" start-stop-daemon --stop --signal USR1 --quiet \ --name nfsd --user root eend $? "Error stopping NFS daemon" } reload() { # Hangup signal to mountd reloads /etc/exports. ebegin "Reloading /etc/exports" start-stop-daemon --signal 1 --quiet --exec $mountd \ --pidfile /var/run/mountd.pid eend $? }