[packages] nfs-kernel-server: fix mount command
[openwrt/svn-archive/archive.git] / net / nfs-kernel-server / files / nfsd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 START=60
5 STOP=60
6
7 NFS_D=/var/lib/nfs
8 LOCK_D=/var/lib/nfs/sm
9
10 start() {
11 grep -q /proc/fs/nfsd /proc/mounts || \
12 mount -t nfsd none /proc/fs/nfsd
13 mkdir -p $NFS_D
14 mkdir -p $LOCK_D
15 touch $NFS_D/rmtab
16
17 sysctl -w fs.nfs.nlm_tcpport=32777 fs.nfs.nlm_udpport=32777 > /dev/null
18 /usr/sbin/rpc.statd -p 32778 -o 32779
19 /usr/sbin/exportfs -r
20 /usr/sbin/rpc.nfsd
21 /usr/sbin/rpc.mountd -p 32780
22 }
23
24 stop() {
25 killall rpc.mountd 2> /dev/null
26 rpc.nfsd 0 2> /dev/null
27 /usr/sbin/exportfs -au
28 killall rpc.statd 2> /dev/null
29 grep -q /proc/fs/nfsd /proc/mounts && \
30 umount /proc/fs/nfsd
31 }
32
33 reload() {
34 /usr/sbin/exportfs -r
35 }
36