diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2010-12-22 10:18:05 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2010-12-22 10:18:05 +0000 |
commit | 559de61b4b92c534a13b71f0dd50631e4f8f47c7 (patch) | |
tree | 4366ac01bc5ab65b6210ddfac61bbe62413c99fb /testing/iscsi-scst | |
parent | e529b59aaf07b81fd60ba5ad649f6fdd5a03ffe7 (diff) | |
download | aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.tar.bz2 aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.tar.xz |
testing/iscsi-scst: fixed init script and added default config
Diffstat (limited to 'testing/iscsi-scst')
-rw-r--r-- | testing/iscsi-scst/APKBUILD | 14 | ||||
-rw-r--r-- | testing/iscsi-scst/iscsi-scst.confd | 1 | ||||
-rw-r--r-- | testing/iscsi-scst/iscsi-scst.initd | 65 | ||||
-rw-r--r-- | testing/iscsi-scst/scst.conf | 7 |
4 files changed, 73 insertions, 14 deletions
diff --git a/testing/iscsi-scst/APKBUILD b/testing/iscsi-scst/APKBUILD index f6f6c85b1b..0d562dc662 100644 --- a/testing/iscsi-scst/APKBUILD +++ b/testing/iscsi-scst/APKBUILD @@ -3,7 +3,7 @@ pkgname=iscsi-scst pkgver=2.0.0 -pkgrel=0 +pkgrel=1 pkgdesc="ISCSI target for SCST - userspace tools" url="http://iscsi-scst.sourceforge.net/" arch="x86_64" @@ -15,7 +15,9 @@ subpackages= _svn="3161" source="http://alpine.nethq.org/distfiles/$pkgname-$pkgver-svn-$_svn.tar.gz http://alpine.nethq.org/distfiles/scst-$pkgver-svn-$_svn.tar.gz - iscsi-scst.initd + $pkgname.initd + $pkgname.confd + scst.conf " _builddir="$srcdir"/$pkgname @@ -33,10 +35,14 @@ package() { cd "$_builddir" # make install is broken install -D usr/iscsi-scstd "$pkgdir"/usr/sbin/iscsi-scstd - install -D usr/iscsi-scst-adm "$pkgdir"/iscsi-scst-adm + install -D usr/iscsi-scst-adm "$pkgdir"/usr/sbin/iscsi-scst-adm install -D -m 755 "$srcdir"/iscsi-scst.initd "$pkgdir"/etc/init.d/iscsi-scst + install -D -m 644 "$srcdir"/iscsi-scst.confd "$pkgdir"/etc/conf.d/iscsi-scst + install -D -m 644 "$srcdir"/scst.conf "$pkgdir"/etc/scst.conf } md5sums="0980e7f0cc57d3a09cc57ba4b127ef12 iscsi-scst-2.0.0-svn-3161.tar.gz 73c1ec37231918e5183e78f1ec8f2302 scst-2.0.0-svn-3161.tar.gz -05efba84051393bf22ff1f2c718afbe9 iscsi-scst.initd" +ce6abcb6365f4b8609c3e963d5243b22 iscsi-scst.initd +6d8b6e27d47748f7805fdb318b62bb3b iscsi-scst.confd +e8eda9872b3da3a55605c7fa17cb6c68 scst.conf" diff --git a/testing/iscsi-scst/iscsi-scst.confd b/testing/iscsi-scst/iscsi-scst.confd new file mode 100644 index 0000000000..1a13034dd2 --- /dev/null +++ b/testing/iscsi-scst/iscsi-scst.confd @@ -0,0 +1 @@ +MEM_SIZE="" diff --git a/testing/iscsi-scst/iscsi-scst.initd b/testing/iscsi-scst/iscsi-scst.initd index 3563bafa7e..b63a3e57d8 100644 --- a/testing/iscsi-scst/iscsi-scst.initd +++ b/testing/iscsi-scst/iscsi-scst.initd @@ -4,20 +4,65 @@ # depend() { - need net - after firewall + 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() { - modprobe -q crc32c - modprobe -q iscsi-scst - ebegin "Starting iscsi-scstd" - start-stop-daemon --start --exec /usr/sbin/iscsi-scstd - eend 0 + 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-scstd" - start-stop-daemon --stop --exec /usr/sbin/iscsi-scstd - eend 0 + ebegin "Stopping iscsi" + start-stop-daemon --stop --exec /usr/sbin/iscsi-scstd + rmmod -w iscsi-scst + eend 0 } + diff --git a/testing/iscsi-scst/scst.conf b/testing/iscsi-scst/scst.conf new file mode 100644 index 0000000000..341a0db9a1 --- /dev/null +++ b/testing/iscsi-scst/scst.conf @@ -0,0 +1,7 @@ +TARGET_DRIVER iscsi { + enabled 1 + + TARGET iqn.2010-12.net.alpinelinux:tgt { + } +} + |