2006-10-04 20:57:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
2006-07-11 19:13:10 +00:00
|
|
|
|
2006-10-15 21:03:30 +00:00
|
|
|
START=60
|
2010-01-30 18:12:57 +00:00
|
|
|
STOP=60
|
|
|
|
|
2006-07-11 19:13:10 +00:00
|
|
|
NFS_D=/var/lib/nfs
|
2009-12-18 19:32:59 +00:00
|
|
|
LOCK_D=/var/lib/nfs/sm
|
2006-07-11 19:13:10 +00:00
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
start() {
|
2010-02-25 02:47:02 +00:00
|
|
|
grep -q /proc/fs/nfsd /proc/mounts || \
|
2010-02-25 02:28:02 +00:00
|
|
|
mount -t nfsd nfsd /proc/fs/nfsd
|
2006-10-04 20:57:49 +00:00
|
|
|
mkdir -p $NFS_D
|
2009-12-18 19:32:59 +00:00
|
|
|
mkdir -p $LOCK_D
|
2006-10-04 20:57:49 +00:00
|
|
|
touch $NFS_D/rmtab
|
2009-12-18 19:32:59 +00:00
|
|
|
|
2010-02-18 16:18:39 +00:00
|
|
|
sysctl -w fs.nfs.nlm_tcpport=32777 fs.nfs.nlm_udpport=32777 > /dev/null
|
|
|
|
/usr/sbin/rpc.statd -p 32778 -o 32779
|
2006-10-04 20:57:49 +00:00
|
|
|
/usr/sbin/exportfs -r
|
|
|
|
/usr/sbin/rpc.nfsd
|
2010-02-18 16:18:39 +00:00
|
|
|
/usr/sbin/rpc.mountd -p 32780
|
2006-07-11 19:13:10 +00:00
|
|
|
}
|
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
stop() {
|
|
|
|
killall rpc.mountd 2> /dev/null
|
2010-02-09 00:12:21 +00:00
|
|
|
rpc.nfsd 0 2> /dev/null
|
2006-10-04 20:57:49 +00:00
|
|
|
/usr/sbin/exportfs -au
|
|
|
|
killall rpc.statd 2> /dev/null
|
2010-02-25 02:55:18 +00:00
|
|
|
grep -q /proc/fs/nfsd /proc/mounts && \
|
2010-02-25 02:28:02 +00:00
|
|
|
umount /proc/fs/nfsd
|
2006-07-11 19:13:10 +00:00
|
|
|
}
|
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
reload() {
|
|
|
|
/usr/sbin/exportfs -r
|
2006-07-11 19:13:10 +00:00
|
|
|
}
|
|
|
|
|