nfs-server.rcS revision 1172:485932298c56
1#!/bin/sh 2# 3# /etc/init.d/rcS 4# 5 6echo -n "mounting swap..." 7/sbin/swapon /dev/hdc1 8echo "done." 9 10echo -n "setting up network..." 11/sbin/ifconfig eth0 10.0.0.1 txqueuelen 1000 12/sbin/ifconfig lo 127.0.0.1 13 14echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle 15echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse 16echo "1" > /proc/sys/net/ipv4/tcp_window_scaling 17echo "0" > /proc/sys/net/ipv4/tcp_timestamps 18echo "0" > /proc/sys/net/ipv4/tcp_sack 19echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout 20echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog 21 22echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range 23echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem 24echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem 25echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem 26 27echo "524287" > /proc/sys/net/core/rmem_max 28echo "524287" > /proc/sys/net/core/wmem_max 29echo "524287" > /proc/sys/net/core/optmem_max 30echo "300000" > /proc/sys/net/core/netdev_max_backlog 31 32echo "131072" > /proc/sys/fs/file-max 33echo "done." 34 35#if [ ! -x /dev/sda ] 36#then 37# mknod /dev/sda b 8 0 38# mknod /dev/sda1 b 8 1 39#fi 40 41/sbin/insmod /modules/scsi_debug.ko dev_size_mb=128 42 43echo -n "creating partition and formatting..." 44echo "1,120,L" > /tmp/sfdisk.run 45/usr/sbin/sfdisk -uM --force /dev/sda < /tmp/sfdisk.run 46/sbin/mke2fs /dev/sda1 47mkdir /nfs 48/bin/mount /dev/sda1 /nfs 49chmod a+rwx /nfs 50/usr/sbin/sfdisk -uM -l /dev/sda 51echo "done." 52 53echo "/nfs 10.0.0.0/255.0.0.0(rw,sync,no_root_squash)" > /etc/exports 54echo -n "starting nfs kernel server..." 55/sbin/portmap 56/sbin/lockd 57/sbin/statd 58/sbin/nfsd 8 59/sbin/mountd 60echo "done." 61 62echo "Exporting shares..." 63/sbin/exportfs -r -v 64 65echo -n "signal client to mount..." 66echo "server ready" | /usr/bin/netcat -c 10.0.0.2 8000 67echo "done." 68 69echo -n "starting bash shell..." 70/bin/bash 71