diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-07-26 14:54:03 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-07-26 14:54:03 +0000 |
commit | a25ab113f02d4a78796fcd434d7d1a7f700a835d (patch) | |
tree | 7f4f850ff7697b5aa62e2b63a64186105abf7c1e /main/iscsi-scst/iscsi-scst.initd | |
parent | addfbe32d5fd892efad607710562ef66f174405d (diff) | |
download | aports-a25ab113f02d4a78796fcd434d7d1a7f700a835d.tar.bz2 aports-a25ab113f02d4a78796fcd434d7d1a7f700a835d.tar.xz |
testing/iscsi-scst: move to main
Diffstat (limited to 'main/iscsi-scst/iscsi-scst.initd')
-rw-r--r-- | main/iscsi-scst/iscsi-scst.initd | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/main/iscsi-scst/iscsi-scst.initd b/main/iscsi-scst/iscsi-scst.initd new file mode 100644 index 000000000..b63a3e57d --- /dev/null +++ b/main/iscsi-scst/iscsi-scst.initd @@ -0,0 +1,68 @@ +#!/sbin/runscript +# +# Start the iSCSI-SCST Target. +# + +depend() { + need net + after firewall +} + +configure_memsize() { + if [ ! -z "$MEM_SIZE" ]; then + if [ -e /proc/sys/net/core/wmem_max ]; then + echo ${MEM_SIZE} > /proc/sys/net/core/wmem_max + fi + + if [ -e /proc/sys/net/core/rmem_max ]; then + echo ${MEM_SIZE} > /proc/sys/net/core/rmem_max + fi + + if [ -e /proc/sys/net/core/wmem_default ]; then + echo ${MEM_SIZE} > /proc/sys/net/core/wmem_default + fi + + if [ -e /proc/sys/net/core/rmem_default ]; then + echo ${MEM_SIZE} > /proc/sys/net/core/rmem_default + fi + + if [ -e /proc/sys/net/ipv4/tcp_mem ]; then + echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_mem + fi + + if [ -e /proc/sys/net/ipv4/tcp_rmem ]; then + echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_rmem + fi + + if [ -e /proc/sys/net/ipv4/tcp_wmem ]; then + echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_wmem + fi + fi +} + +check_dev_handlers() { + if lsmod | grep "scst_" >/dev/null; then + ewarn "Device handlers found" + else + ewarn "No SCST device handlers loaded!" + ewarn "You can add them in /etc/modules" + fi +} + +start() { + ebegin "Starting iscsi" + check_dev_handlers + modprobe -q crc32c + modprobe -q iscsi-scst + start-stop-daemon --start --exec /usr/sbin/iscsi-scstd + /usr/sbin/scstadmin -config /etc/scst.conf + eend 0 +} + +stop() { + ebegin "Stopping iscsi" + start-stop-daemon --stop --exec /usr/sbin/iscsi-scstd + rmmod -w iscsi-scst + eend 0 +} + |