From 780792f2c09326bd027a94fb166e6daf445f6514 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Sun, 1 May 2011 23:55:13 +0000 Subject: [PATCH] rpc.statd is required for mounting nfs shares. Added to mounnetfs bootscript --- stage2/bootscripts/mountnetfs | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/stage2/bootscripts/mountnetfs b/stage2/bootscripts/mountnetfs index d812d80..55c48af 100755 --- a/stage2/bootscripts/mountnetfs +++ b/stage2/bootscripts/mountnetfs @@ -7,6 +7,30 @@ source /etc/rc.d/init.d/functions log_script_name "$0 $*" +mountnetfs_start() { + if ! grep -q "_netdev" /etc/fstab; then + echo "No network filesystem found in fstab" + exit ${EXIT_CODE_WARNING} + fi + + if grep -q "nfs" /etc/fstab; then + # rpc.statd is required to mount nfs shares + if [ ! -x /sbin/rpc.statd ]; then + echo "Missing rpc.statd executable" + exit ${EXIT_CODE_WARNING} + fi + + if statusproc rpc.statd | grep -q "not running"; then + cmd_run_log_box "Starting rpc.statd" loadproc rpc.statd + fi + fi + + # Walk through /etc/fstab and mount all file systems that have the + #_netdev option set in the fs_mntops field (the 4th field. See man + # fstab for more info). + cmd_run_log_box "Mounting network file systems" mount -a -O _netdev +} + mountnetfs_stop() { # The following line obtains a list from the output of # mount for all netfs types and anything that was @@ -22,7 +46,7 @@ mountnetfs_stop() { # Try and stop processes the nice way # (probably won't work in most cases) /bin/fuser -TERM -m $NETMOUNTS > /dev/null - + # Check and see if it found anything. If it # did, then give 3 seconds for things to exit # the nice way before killing them off. @@ -60,17 +84,16 @@ mountnetfs_stop() { fi } - case "$1" in start) - # Walk through /etc/fstab and mount all file systems that have the - # _netdev option set in the fs_mntops field (the 4th field. See man - # fstab for more info). - cmd_run_log_box "Mounting network file systems" mount -a -O _netdev + mountnetfs_start ;; stop) cmd_run_log_box "Unmounting network file systems" mountnetfs_stop + if statusproc rpc.statd | grep -q "running with"; then + cmd_run_log_box "Stopping rpc.statd" killproc rpc.statd + fi ;; *) -- 2.20.1