Find the answer to your Linux question:
Results 1 to 4 of 4
Can you please have a look at this for me? When I run it I get exit 0 not found I am a newbie to linux, its a script provided ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    6

    nfs startup script

    Can you please have a look at this for me? When I run it I get exit 0 not found


    I am a newbie to linux, its a script provided by a website, but I guess with an error?

    #!/bin/sh
    #
    # Start NFS
    #

    start() {
    echo "Starting NFS"
    /sbin/modprobe nfsd
    sleep 2
    start-stop-daemon --start --exec /sbin/portmap
    start-stop-daemon --start --exec /usr/sbin/rpc.mountd
    start-stop-daemon --start --exec /usr/sbin/rpc.nfsd
    start-stop-daemon --start --exec /usr/sbin/rpc.statd
    start-stop-daemon --start --exec /usr/sbin/rpc.lockd
    start-stop-daemon --start --exec /usr/sbin/rpc.rquotad
    /usr/sbin/exportfs -a # explicit exportfs is required!
    }

    stop() {
    echo "Stopping NFS"
    start-stop-daemon --stop --exec /usr/sbin/rpc.rquotad
    start-stop-daemon --stop --exec /usr/sbin/rpc.lockd
    start-stop-daemon --stop --exec /usr/sbin/rpc.statd
    start-stop-daemon --stop --exec /usr/sbin/rpc.nfsd
    start-stop-daemon --stop --exec /usr/sbin/rpc.mountd
    start-stop-daemon --stop --exec /sbin/portmap
    }

    restart() {
    stop
    start
    }

    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    restart)
    restart
    ;;
    cleanup)
    ;;
    *)
    echo $"Usage: $0 {start|stop|restart}"
    exit 1
    esac

    exit $?

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    your distro should already have an init script for nfs, what distro are you using?

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    6
    A western digital my book world edition

    Linux version 2.6.17.14 (clarke@mccoy.oxsemi.com.asic.oxsemi.com) (gcc version 4.1.0) #1 PREEMPT Mon Mar 26 12:36:33 BST 2007

  4. #4
    Just Joined!
    Join Date
    Mar 2006
    Posts
    29
    remove the last $? after the last exit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...