#!/bin/bash PROGRAM=/bin/false RUNLEVEL=3 NEEDS="+network +portmap" . /etc/init.d/smgl_init . /etc/sysconfig/nfs if [[ ! -e /etc/exports ]]; then $FAILURE echo "Please create an /etc/exports file. Exiting without starting nfs..." $NORMAL exit 1 fi if [[ -e /usr/sbin/rpc.idmapd ]]; then HASNFS4=1 fi # pseudo fs stuff mount_nfsd() { if grep -q 'nfsd' /proc/filesystems; then if ! grep -q 'nfsd' /etc/mtab; then required_executable /bin/mount echo "mounting nfsd" mount -t nfsd nfsd /proc/fs/nfsd evaluate_retval fi fi } umount_nfsd() { if grep -q 'nfsd' /etc/mtab; then required_executable /bin/umount echo "unmounting nfsd" umount /proc/fs/nfsd evaluate_retval fi } mount_pipefs() { if grep -q 'rpc_pipefs' /proc/filesystems; then if ! grep -q 'rpc_pipefs' /etc/mtab; then required_executable /bin/mount echo "mounting pipefs" mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs evaluate_retval fi fi } umount_pipefs() { if grep -q 'rpc_pipefs' /etc/mtab; then required_executable /bin/umount echo "unmounting pipefs" umount /var/lib/nfs/rpc_pipefs evaluate_retval fi } # for making sure these exist mknfsdirs() { local d for d in /var/lib/nfs/{rpc_pipefs,v4recovery,v4root}; do [[ ! -d "${d}" ]] && mkdir -p "${d}" done } # may be outsourced get_kernel_pids() { local rval=1 for pid in $(pidof $1) do if [[ -z $(