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