X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage3%2Fbootscripts%2Fnfs;h=e20b2b521da99b5110b7aa6ce4cb72862fe6eb02;hb=2d56e369dbc033f743dfcc0b392c844d6299937b;hp=e8621b73b75efb49a399cb31a7e5150568a0c2c9;hpb=be41960e19c9daee738916df4138559a262ca34a;p=hvlinux.git diff --git a/stage3/bootscripts/nfs b/stage3/bootscripts/nfs index e8621b7..e20b2b5 100755 --- a/stage3/bootscripts/nfs +++ b/stage3/bootscripts/nfs @@ -18,16 +18,21 @@ source /etc/sysconfig/network/network-parameters # Check that networking is up. #[ ${NETWORKING} = "no" ] && exit ${EXIT_CODE_WARNING} +# Check if NFS server functionality is desired +if [ "x${NFS_SERVER_ENA}" != "xyes" -a "x${NFS_SERVER_ENA}" != "xYes" -a "x${NFS_SERVER_ENA}" != "xYES" ]; then + exit ${EXIT_CODE_SUCCESS} +fi + # Check for presence of executables -if [ ! -x /usr/sbin/rpc.nfsd ]; then +if [ ! -x /sbin/rpc.nfsd ]; then echo "Missing rpc.nfsd executable" exit ${EXIT_CODE_WARNING} fi -if [ ! -x /usr/sbin/rpc.mountd ]; then +if [ ! -x /sbin/rpc.mountd ]; then echo "Missing rpc.mountd executable" exit ${EXIT_CODE_WARNING} fi -if [ ! -x /usr/sbin/exportfs ]; then +if [ ! -x /sbin/exportfs ]; then echo "Missing exportfs executable" exit ${EXIT_CODE_WARNING} fi @@ -36,11 +41,6 @@ if [ ! -s /etc/exports ]; then exit ${EXIT_CODE_WARNING} fi -if [ "x${NFS_SERVER_ENA}" != "xyes" -a "x${NFS_SERVER_ENA}" != "xYes" -a "x${NFS_SERVER_ENA}" != "xYES" ]; then - msg_log "NFS server disabled in '/etc/sysconfig/network/network-parameters'" - exit ${EXIT_CODE_WARNING} -fi - # Check for and source configuration file otherwise set defaults # TUNE_QUEUE: controls whether to up the size of input queues [ -f /etc/sysconfig/network/nfs ] && . /etc/sysconfig/network/nfs @@ -72,19 +72,19 @@ nfsd_start() { /sbin/sysctl -w net.core.rmem_default=$NFSD_QS >/dev/null 2>&1 /sbin/sysctl -w net.core.rmem_max=$NFSD_QS >/dev/null 2>&1 fi - cmd_run_log_box "Starting NFS services" loadproc /usr/sbin/exportfs -ra + cmd_run_log_box "Starting NFS services" loadproc /sbin/exportfs -ra if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then cmd_run_log_box "Starting NFS quotas" loadproc rpc.rquotad fi cmd_run_log_box "Starting NFS daemon" loadproc rpc.nfsd $NFSDCOUNT - + [ -n "$MOUNTD_PORT" ] \ && MOUNTD_OPTIONS="$MOUNTD_OPTIONS -p $MOUNTD_PORT" [ "$MOUNTD_TCP" = "no" -o "$MOUNTD_TCP" = "NO" ] \ && MOUNTD_OPTIONS="$MOUNTD_OPTIONS --no-tcp" - + cmd_run_log_box "Starting NFS mountd" loadproc rpc.mountd $MOUNTD_OPTIONS - + touch /var/lock/subsys/nfs # reset input queue for rest of network services if [ "$TUNE_QUEUE" = "yes" ]; then @@ -103,7 +103,7 @@ nfsd_stop() { # Do it the last so that clients can still access the server # when the server is running. echo "Refreshing NFS Exported Filesystems..." - /usr/sbin/exportfs -au + /sbin/exportfs -au rm -f /var/lock/subsys/nfs } @@ -114,16 +114,16 @@ case "$1" in start) cmd_run_log_box_warn "NFS server start" nfsd_start ;; - + stop) cmd_run_log_box_warn "NFS server stop" nfsd_stop ;; - + reload) - /usr/sbin/exportfs -ra + /sbin/exportfs -ra touch /var/lock/subsys/nfs ;; - + restart) $0 stop sleep 1 @@ -137,7 +137,7 @@ case "$1" in statusproc rpc.rquotad fi ;; - + *) echo "Usage: $0 {reload|restart|start|status|stop}" exit ${EXIT_CODE_FAILURE}