]> git.pld-linux.org Git - packages/nfs-utils.git/blame - nfs.init
new patches/updates
[packages/nfs-utils.git] / nfs.init
CommitLineData
bf44c74c 1#!/bin/sh
083dbab7 2#
3# nfs This shell script takes care of starting and stopping
4# the NFS services. Later we might add NIS too.
5#
0e3733a2 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
083dbab7 11
0e3733a2 12
13# Source function library
083dbab7 14. /etc/rc.d/init.d/functions
15
0e3733a2 16# Get network config
083dbab7 17. /etc/sysconfig/network
18
0e3733a2 19# Get service config
20[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
21
083dbab7 22# Check that networking is up.
724a0177 23[ "${NETWORKING}" = "no" ] && echo "Error: Networking is down" && exit 0
083dbab7 24
0e3733a2 25# Sanity check
083dbab7 26[ -f /etc/exports ] || exit 0
27
0e3733a2 28
083dbab7 29# See how we were called.
30case "$1" in
31 start)
0e3733a2 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
083dbab7 41 touch /var/lock/subsys/nfs
42 ;;
43 stop)
44 # Stop daemons.
bf44c74c 45 show Shutting down rpc.mountd
46 killproc rpc.mountd
47 show Shutting down rpc.nfsd
48 killproc rpc.nfsd
083dbab7 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
62esac
63
64exit 0
65
This page took 0.068576 seconds and 4 git commands to generate.