]> git.pld-linux.org Git - packages/nfs-utils.git/blob - nfs.init
- standarized reaction if NETWRKING=no.
[packages/nfs-utils.git] / nfs.init
1 #!/bin/sh
2 #
3 # nfs           This shell script takes care of starting and stopping
4 #               the NFS services. Later we might add NIS too.
5 #
6 # chkconfig:    345 60 20
7 # description:  NFS is a popular protocol for file sharing across TCP/IP \
8 #               networks. This service provides NFS server functionality, \
9 #               which is configured via the /etc/exports file.
10 # probe:        true
11
12
13 # Source function library
14 . /etc/rc.d/init.d/functions
15
16 # Get network config
17 . /etc/sysconfig/network
18
19 # Get service config
20 [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
21
22 # Check that networking is up.
23 [ "${NETWORKING}" = "no" ] && echo "Error: Networking is down" && exit 0
24
25 # Sanity check
26 [ -f /etc/exports ] || exit 0
27
28
29 # See how we were called.
30 case "$1" in
31   start)
32         # Check if the service is already running?
33         if [ ! -f /var/lock/subsys/nfs ]; then
34                 show Starting rpc.mountd
35                 daemon rpc.mountd
36                 show Starting rpc.nfsd
37                 daemon rpc.nfsd
38         else
39                 echo "nfs already is running"
40         fi
41         touch /var/lock/subsys/nfs
42         ;;
43   stop)
44         # Stop daemons.
45         show Shutting down rpc.mountd
46         killproc rpc.mountd
47         show Shutting down rpc.nfsd
48         killproc rpc.nfsd
49         rm -f /var/lock/subsys/nfs
50         ;;
51   status)
52         status rpc.mountd
53         status rpc.nfsd
54         ;;
55   restart)
56         $0 stop
57         $0 start
58         ;;
59   *)
60         echo "Usage: $0 {start|stop|status|restart}"
61         exit 1
62 esac
63
64 exit 0
65
This page took 0.033822 seconds and 4 git commands to generate.