summaryrefslogtreecommitdiff
path: root/packages/nfs-utils/files/nfsserver
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@nslu2-linux.org>2005-07-10 16:26:42 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-07-10 16:26:42 +0000
commit89027227a484061647e511c9d1f0405bab4426eb (patch)
treec52cc47d531235282cf7b377e79cd14c6ba6aa16 /packages/nfs-utils/files/nfsserver
parent44deec998e21fb36ada17da670edd6afe138451f (diff)
Working, tested, nfs-utils. This now pulls in all the dependencies on
ipkg install and has a working startup script.
Diffstat (limited to 'packages/nfs-utils/files/nfsserver')
-rw-r--r--packages/nfs-utils/files/nfsserver30
1 files changed, 28 insertions, 2 deletions
diff --git a/packages/nfs-utils/files/nfsserver b/packages/nfs-utils/files/nfsserver
index 3536f0db12..36391ee85a 100644
--- a/packages/nfs-utils/files/nfsserver
+++ b/packages/nfs-utils/files/nfsserver
@@ -22,9 +22,34 @@ test -x "$NFS_NFSD" || exit 0
# ridiculous 99
test "$NFS_SERVERS" -gt 0 && "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
#
+# The default state directory is /var/lib/nfs
+test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
+#
#----------------------------------------------------------------------
# Startup and shutdown functions.
# Actual startup/shutdown is at the end of this file.
+#directories
+create_directories(){
+ echo -n 'creating NFS state directory: '
+ mkdir -p "$NFS_STATEDIR"
+ ( cd "$NFS_STATEDIR"
+ umask 077
+ mkdir -p sm sm.bak
+ test -w sm/state || {
+ rm -f sm/state
+ :>sm/state
+ }
+ umask 022
+ for file in xtab etab smtab rmtab
+ do
+ test -w "$file" || {
+ rm -f "$file"
+ :>"$file"
+ }
+ done
+ )
+ echo done
+}
#mountd
start_mountd(){
echo -n 'starting mountd: '
@@ -39,7 +64,7 @@ stop_mountd(){
#
#nfsd
start_nfsd(){
- echo -n 'starting $1 nfsd kernel threads: '
+ echo -n "starting $1 nfsd kernel threads: "
start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
echo done
}
@@ -90,7 +115,8 @@ stop_nfsd(){
# restart: stops and starts mountd
#FIXME: need to create the /var/lib/nfs/... directories
case "$1" in
-start) start_nfsd "$NFS_SERVERS"
+start) create_directories
+ start_nfsd "$NFS_SERVERS"
start_mountd
test -r /etc/exports && exportfs -a;;
stop) exportfs -ua