]> git.pld-linux.org Git - packages/nfs-utils.git/blob - nfs.init
drobiazg
[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 # Source function library.
13 . /etc/rc.d/init.d/functions
14
15 # Source networking configuration.
16 . /etc/sysconfig/network
17
18 # Check that networking is up.
19 [ "${NETWORKING}" = "no" ] && exit 0
20
21 [ -f /usr/sbin/rpc.nfsd ] || exit 0
22 [ -f /usr/sbin/rpc.mountd ] || exit 0
23 [ -f /etc/exports ] || exit 0
24
25 # Get sysconfig
26 if [ -f /etc/sysconfig/nfs ]; then
27     . /etc/sysconfig/nfs
28 fi    
29 # See how we were called.
30 case "$1" in
31   start)
32         # Start daemons.
33         show Starting rpc.mountd
34         daemon rpc.mountd
35         show Starting rpc.nfsd
36         daemon rpc.nfsd
37         touch /var/lock/subsys/nfs
38         ;;
39   stop)
40         # Stop daemons.
41         show Shutting down rpc.mountd
42         killproc rpc.mountd
43         show Shutting down rpc.nfsd
44         killproc rpc.nfsd
45         rm -f /var/lock/subsys/nfs
46         ;;
47   status)
48         status rpc.mountd
49         status rpc.nfsd
50         ;;
51   restart)
52         $0 stop
53         $0 start
54         ;;
55   *)
56         echo "Usage: $0 {start|stop|status|restart}"
57         exit 1
58 esac
59
60 exit 0
61
This page took 0.048758 seconds and 4 git commands to generate.