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