Hi,
attached is possible fix. Please let me know if I should NMU.
Cheers,
 -- Guido
>From 54295af79cd7a3c9ec0b355c3babb27dd5feac98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <[email protected]>
Date: Sat, 23 Jan 2010 15:03:31 +0100
Subject: [PATCH] Let propcs handle the sysctl nobs

to  make it more obvious to the sysadmin what's going on.

Closes: #543604
---
 debian/30-iscsitarget.conf |    9 +++++++++
 debian/iscsitarget.init    |   40 ++--------------------------------------
 debian/rules               |    5 +++--
 3 files changed, 14 insertions(+), 40 deletions(-)
 create mode 100644 debian/30-iscsitarget.conf

diff --git a/debian/30-iscsitarget.conf b/debian/30-iscsitarget.conf
new file mode 100644
index 0000000..aa648b3
--- /dev/null
+++ b/debian/30-iscsitarget.conf
@@ -0,0 +1,9 @@
+# Increses send and receive buffers for iSCSI
+
+net.core.wmem_max=1048576
+net.core.rmem_max=1048576
+net.core.wmem_default=1048576
+net.core.rmem_default=1048576
+net.ipv4.tcp_mem=1048576
+net.ipv4.tcp_rmem=1048576
+net.ipv4.tcp_wmem=1048576
diff --git a/debian/iscsitarget.init b/debian/iscsitarget.init
index fdf04f3..d22c947 100644
--- a/debian/iscsitarget.init
+++ b/debian/iscsitarget.init
@@ -2,8 +2,8 @@
 #
 ### BEGIN INIT INFO
 # Provides:          iscsitarget
-# Required-Start:    $remote_fs $syslog $network $time
-# Required-Stop:     $remote_fs $syslog $network $time
+# Required-Start:    $remote_fs $syslog $network $time procps
+# Required-Stop:     $remote_fs $syslog $network $time procps
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: Starts and stops the iSCSI target
@@ -15,10 +15,6 @@ DAEMON=/usr/sbin/ietd
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-# Don't touch this "memsize thingy" unless you are blessed
-# with knowledge about it.
-MEM_SIZE=1048576
-
 . /lib/lsb/init-functions # log_{warn,failure}_msg
 ISCSITARGET_ENABLE=false
 ISCSITARGET_DEFAULTS_FILE=/etc/default/iscsitarget
@@ -34,43 +30,11 @@ if [ -s "$ISCSITARGET_DEFAULTS_FILE" ]; then
     esac
 fi
 
-configure_memsize()
-{
-    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
-}
-
 RETVAL=0
 
 ietd_start()
 {
 	echo -n "Starting iSCSI enterprise target service: "
-	configure_memsize
 	modprobe -q crc32c
 	modprobe iscsi_trgt
 	RETVAL=$?
diff --git a/debian/rules b/debian/rules
index 1aff267..b07fbce 100755
--- a/debian/rules
+++ b/debian/rules
@@ -141,8 +141,9 @@ install-arch:
 	mkdir -p debian/iscsitarget/usr/share/lintian/overrides
 	cp debian/iscsitarget.overrides \
 		debian/iscsitarget/usr/share/lintian/overrides/iscsitarget
-	
-
+	# Add sysctl tune nobs
+	install -D -m 644 debian/30-iscsitarget.conf \
+		debian/iscsitarget/etc/sysctl.d/30-iscsitarget.conf
 
 # Must not depend on anything. This is to be called by
 # binary-arch/binary-indep
-- 
1.6.6

Reply via email to