]> git.decadent.org.uk Git - nfs-utils.git/blob - etc/nodist/nfs-client
Minor fix - put nfsd before mountd rpcinfo query.
[nfs-utils.git] / etc / nodist / nfs-client
1 #!/bin/sh
2 # nfs   This shell script starts and stops the nfs services in a distribution
3 #       independent fashion.
4 ## description:  starts and stops nfs client services
5 # chkconfig: 2345 99 01
6 #
7 # Copyright (c) 2000-2001 Mission Critical Linux, Inc.
8 #
9
10 PATH=/sbin:/bin:/usr/sbin:/usr/bin
11 export PATH
12
13 # Who am I?
14 SCRIPT_NAME=`basename $0`
15
16 # Grab our daemon functions.
17 . `dirname $0`/nfs-functions
18
19 # Kernel daemons and options
20 PREFIX="rpc."           # Prefix for kernel execs (usually "rpc.")
21 LOCKD="lockd"           # Lockd
22
23 # User daemons and options
24 STATD="rpc.statd"       # NLM Server
25
26 # We use "type -path" instead of "which" since it's internal to bash.
27 [ -x "`type -path $STATD`" ] || exit 0
28 [ -x "`type -path $PREFIX$LOCKD`" ] || exit 0
29
30 # Handle how we were called.
31 case "$1" in
32 start)
33     # Start rpc.statd daemon without options...
34     echo -n "Starting $STATD: "
35     startdaemon $STATD
36
37     echo -n "Starting $LOCKD: "
38     startdaemon $PREFIX$LOCKD
39
40     # if this lock file doesn't exist, init won't even try to run
41     # the shutdown script for this service on RedHat systems!
42     # on non-RedHat systems, /var/lock/subsys may not exist.
43     touch /var/lock/subsys/$SCRIPT_NAME &> /dev/null
44     ;;
45
46 stop)
47     echo -n "Stopping $STATD: "
48     stopdaemon $STATD
49
50     echo -n "Stopping $LOCKD: "
51     stopdaemon $LOCKD
52
53     rm -f /var/lock/subsys/$SCRIPT_NAME 
54     ;;
55
56 restart)
57     $0 stop
58     $0 start
59     ;;
60
61 status)
62     daemonstatus $STATD
63     daemonstatus $LOCKD
64
65     exit 0
66     ;;
67
68 *)
69     echo "Usage: $0 {start|stop|status|restart}"
70     exit 1
71 esac
72
73 exit 0