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 | |
parent | e529b59aaf07b81fd60ba5ad649f6fdd5a03ffe7 (diff) | |
download | alpine_aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.tar.bz2 alpine_aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.tar.xz alpine_aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.zip |
testing/iscsi-scst: fixed init script and added default config
-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 @@ | |||
3 | 3 | ||
4 | pkgname=iscsi-scst | 4 | pkgname=iscsi-scst |
5 | pkgver=2.0.0 | 5 | pkgver=2.0.0 |
6 | pkgrel=0 | 6 | pkgrel=1 |
7 | pkgdesc="ISCSI target for SCST - userspace tools" | 7 | pkgdesc="ISCSI target for SCST - userspace tools" |
8 | url="http://iscsi-scst.sourceforge.net/" | 8 | url="http://iscsi-scst.sourceforge.net/" |
9 | arch="x86_64" | 9 | arch="x86_64" |
@@ -15,7 +15,9 @@ subpackages= | |||
15 | _svn="3161" | 15 | _svn="3161" |
16 | source="http://alpine.nethq.org/distfiles/$pkgname-$pkgver-svn-$_svn.tar.gz | 16 | source="http://alpine.nethq.org/distfiles/$pkgname-$pkgver-svn-$_svn.tar.gz |
17 | http://alpine.nethq.org/distfiles/scst-$pkgver-svn-$_svn.tar.gz | 17 | http://alpine.nethq.org/distfiles/scst-$pkgver-svn-$_svn.tar.gz |
18 | iscsi-scst.initd | 18 | $pkgname.initd |
19 | $pkgname.confd | ||
20 | scst.conf | ||
19 | " | 21 | " |
20 | 22 | ||
21 | _builddir="$srcdir"/$pkgname | 23 | _builddir="$srcdir"/$pkgname |
@@ -33,10 +35,14 @@ package() { | |||
33 | cd "$_builddir" | 35 | cd "$_builddir" |
34 | # make install is broken | 36 | # make install is broken |
35 | install -D usr/iscsi-scstd "$pkgdir"/usr/sbin/iscsi-scstd | 37 | install -D usr/iscsi-scstd "$pkgdir"/usr/sbin/iscsi-scstd |
36 | install -D usr/iscsi-scst-adm "$pkgdir"/iscsi-scst-adm | 38 | install -D usr/iscsi-scst-adm "$pkgdir"/usr/sbin/iscsi-scst-adm |
37 | install -D -m 755 "$srcdir"/iscsi-scst.initd "$pkgdir"/etc/init.d/iscsi-scst | 39 | install -D -m 755 "$srcdir"/iscsi-scst.initd "$pkgdir"/etc/init.d/iscsi-scst |
40 | install -D -m 644 "$srcdir"/iscsi-scst.confd "$pkgdir"/etc/conf.d/iscsi-scst | ||
41 | install -D -m 644 "$srcdir"/scst.conf "$pkgdir"/etc/scst.conf | ||
38 | } | 42 | } |
39 | 43 | ||
40 | md5sums="0980e7f0cc57d3a09cc57ba4b127ef12 iscsi-scst-2.0.0-svn-3161.tar.gz | 44 | md5sums="0980e7f0cc57d3a09cc57ba4b127ef12 iscsi-scst-2.0.0-svn-3161.tar.gz |
41 | 73c1ec37231918e5183e78f1ec8f2302 scst-2.0.0-svn-3161.tar.gz | 45 | 73c1ec37231918e5183e78f1ec8f2302 scst-2.0.0-svn-3161.tar.gz |
42 | 05efba84051393bf22ff1f2c718afbe9 iscsi-scst.initd" | 46 | ce6abcb6365f4b8609c3e963d5243b22 iscsi-scst.initd |
47 | 6d8b6e27d47748f7805fdb318b62bb3b iscsi-scst.confd | ||
48 | 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 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | depend() { | 6 | depend() { |
7 | need net | 7 | need net |
8 | after firewall | 8 | after firewall |
9 | } | ||
10 | |||
11 | configure_memsize() { | ||
12 | if [ ! -z "$MEM_SIZE" ]; then | ||
13 | if [ -e /proc/sys/net/core/wmem_max ]; then | ||
14 | echo ${MEM_SIZE} > /proc/sys/net/core/wmem_max | ||
15 | fi | ||
16 | |||
17 | if [ -e /proc/sys/net/core/rmem_max ]; then | ||
18 | echo ${MEM_SIZE} > /proc/sys/net/core/rmem_max | ||
19 | fi | ||
20 | |||
21 | if [ -e /proc/sys/net/core/wmem_default ]; then | ||
22 | echo ${MEM_SIZE} > /proc/sys/net/core/wmem_default | ||
23 | fi | ||
24 | |||
25 | if [ -e /proc/sys/net/core/rmem_default ]; then | ||
26 | echo ${MEM_SIZE} > /proc/sys/net/core/rmem_default | ||
27 | fi | ||
28 | |||
29 | if [ -e /proc/sys/net/ipv4/tcp_mem ]; then | ||
30 | echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_mem | ||
31 | fi | ||
32 | |||
33 | if [ -e /proc/sys/net/ipv4/tcp_rmem ]; then | ||
34 | echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_rmem | ||
35 | fi | ||
36 | |||
37 | if [ -e /proc/sys/net/ipv4/tcp_wmem ]; then | ||
38 | echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_wmem | ||
39 | fi | ||
40 | fi | ||
41 | } | ||
42 | |||
43 | check_dev_handlers() { | ||
44 | if lsmod | grep "scst_" >/dev/null; then | ||
45 | ewarn "Device handlers found" | ||
46 | else | ||
47 | ewarn "No SCST device handlers loaded!" | ||
48 | ewarn "You can add them in /etc/modules" | ||
49 | fi | ||
9 | } | 50 | } |
10 | 51 | ||
11 | start() { | 52 | start() { |
12 | modprobe -q crc32c | 53 | ebegin "Starting iscsi" |
13 | modprobe -q iscsi-scst | 54 | check_dev_handlers |
14 | ebegin "Starting iscsi-scstd" | 55 | modprobe -q crc32c |
15 | start-stop-daemon --start --exec /usr/sbin/iscsi-scstd | 56 | modprobe -q iscsi-scst |
16 | eend 0 | 57 | start-stop-daemon --start --exec /usr/sbin/iscsi-scstd |
58 | /usr/sbin/scstadmin -config /etc/scst.conf | ||
59 | eend 0 | ||
17 | } | 60 | } |
18 | 61 | ||
19 | stop() { | 62 | stop() { |
20 | ebegin "Stopping iscsi-scstd" | 63 | ebegin "Stopping iscsi" |
21 | start-stop-daemon --stop --exec /usr/sbin/iscsi-scstd | 64 | start-stop-daemon --stop --exec /usr/sbin/iscsi-scstd |
22 | eend 0 | 65 | rmmod -w iscsi-scst |
66 | eend 0 | ||
23 | } | 67 | } |
68 | |||
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 @@ | |||
1 | TARGET_DRIVER iscsi { | ||
2 | enabled 1 | ||
3 | |||
4 | TARGET iqn.2010-12.net.alpinelinux:tgt { | ||
5 | } | ||
6 | } | ||
7 | |||