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