iscsi-client.rcS revision 1787:0dcbb68fbea8
1#!/bin/sh 2# 3# /etc/init.d/rcS 4# 5 6echo -n "mounting swap..." 7/sbin/swapon /dev/hdc 8echo "done." 9 10echo -n "setting up network..." 11/sbin/ifconfig lo 127.0.0.1 12/sbin/ifconfig eth0 192.168.0.10 txqueuelen 1000 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 21echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max 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#echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max 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 31echo "131072" > /proc/sys/fs/file-max 32echo "10" > /proc/sys/vm/dirty_writeback_centisecs 33echo "done." 34 35cat > /etc/initiatorname.iscsi <<EOF 36InitiatorName=iqn.1987-05.com.cisco:01.fdb170a0a01b 37EOF 38 39cat > /etc/iscsi.conf <<EOF 40DiscoveryAddress=192.168.0.1 41TargetName=iqn.2005-05.edu.umich:storage.m5 42OutgoingUsername=test 43OutgoingPassword=secret 44EOF 45 46mount -t sysfs none /sys 47 48echo "" > /var/log/iscsi.log 49chmod 0600 /var/log/iscsi.log 50 51# Required for udev to activate/deactivate devices. 52echo "/sbin/hotplug" > /proc/sys/kernel/hotplug 53 54/sbin/insmod /modules/iscsi_sfnet.ko 55 56# Create /dev/iscsictl 57if [ ! -f /dev/iscsictl ]; then 58 while read major device 59 do 60 if [ "$device" == "iscsictl" ]; then 61 mknod /dev/$device c $major 0 62 fi 63 done < /proc/devices 64fi 65 66echo -n "waiting for server..." 67/usr/bin/netcat -c -l -p 8000 68 69echo -n "Starting iscsid..." 70/iscsi/iscsid 71echo "done." 72 73sleep 5 74 75mount /dev/sda /mnt 76cd /mnt 77 78initparam=`cat /proc/m5/initparam` 79 80if test X$initparam == X0; then 81 /sbin/m5 checkpoint 100000000 2000000000 82 dd if=/dev/zero of=foo bs=1024k count=512 83else 84 /sbin/m5 checkpoint 1000000000 2000000000 85 /benchmarks/dbench/dbench $initparam 86fi 87 88echo "starting bash shell..." 89/bin/bash 90 91echo -n "halting machine" 92m5 exit 93