nfs-server.rcS revision 1160:ece5a439d929
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,120,L" > /tmp/sfdisk.run 51/usr/sbin/sfdisk -uM --force /dev/sda < /tmp/sfdisk.run 52/sbin/mke2fs /dev/sda1 53mkdir /nfs 54/bin/mount /dev/sda1 /nfs 55chmod a+rwx /nfs 56/usr/sbin/sfdisk -uM -l /dev/sda 57echo "done." 58 59echo -n "starting nfs kernel server..." 60/sbin/nfsd 8 & 61/sbin/statd & 62/sbin/portmap & 63/sbin/lockd & 64/sbin/mountd & 65echo "done." 66 67echo "Exporting shares..." 68/sbin/exportfs -r -v 69 70echo -n "signal client to mount..." 71echo "server ready" | /usr/bin/netcat -c 10.0.0.2 8000 72echo "done." 73 74 75echo -n "starting bash shell..." 76/bin/bash 77