diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 29532c64d..83adbde32 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -48,17 +48,6 @@ include/iscsi_scst_itf_ver.h: include/iscsi_scst.h install: all @install -vD -m 755 usr/iscsi-scstd $(DESTDIR)$(SBINDIR)/iscsi-scstd @install -vD -m 755 usr/iscsi-scst-adm $(DESTDIR)$(SBINDIR)/iscsi-scst-adm - if [ -f /etc/debian_version ]; then \ - install -vD -m 755 etc/initd/initd.debian $(DESTDIR)$(INITDIR)/iscsi-scst; \ - elif [ -f /etc/redhat-release ]; then \ - install -vD -m 755 etc/initd/initd.redhat $(DESTDIR)$(INITDIR)/iscsi-scst; \ - elif [ -f /etc/gentoo-release ]; then \ - install -vD -m 755 etc/initd/initd.gentoo $(DESTDIR)$(INITDIR)/iscsi-scst; \ - elif [ -f /etc/slackware-version ]; then \ - install -vD -m 755 etc/initd/initd $(DESTDIR)$(RCDIR)/iscsi-scst; \ - else \ - install -vD -m 755 etc/initd/initd $(DESTDIR)$(INITDIR)/iscsi-scst; \ - fi @eval `sed -n 's/#define UTS_RELEASE /KERNELRELEASE=/p' $(KDIR)/include/linux/version.h $(KDIR)/include/linux/utsrelease.h 2>/dev/null`; \ install -vD -m 644 kernel/iscsi-scst.ko \ $(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra/iscsi-scst.ko diff --git a/iscsi-scst/etc/initd/initd b/iscsi-scst/etc/initd/initd deleted file mode 100644 index 9126fcb20..000000000 --- a/iscsi-scst/etc/initd/initd +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# -# Start the iSCSI-SCST Target. -# - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin -MEM_SIZE=1048576 -SCST_CMD=/usr/local/sbin/scstadmin -SCST_CFG=/etc/scst.conf - -# Additional modules to load/unload -ADD_MODULES="scst_vdisk scst" - -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 -} - -start_server() -{ -# configure_memsize - - modprobe -q crc32c 2>/dev/null - modprobe -q crc32c-intel 2>/dev/null - modprobe iscsi-scst || { exit $? ; } - for module in ${ADD_MODULES}; do - modprobe ${module} || { exit 1 ; } - done - - /usr/local/sbin/iscsi-scstd - - $SCST_CMD -config $SCST_CFG || { exit $? ; } -} - -stop_server() -{ - killall iscsi-scstd - rmmod -w iscsi-scst || { exit $? ; } - rmmod ${ADD_MODULES} || { exit $? ; } -} - -case "$1" in - start) - start_server - ;; - stop) - stop_server - ;; - restart) - stop_server - start_server - ;; - *) - echo "Usage: {start|stop}" >&2 - exit 1 - ;; -esac - -exit $? diff --git a/iscsi-scst/etc/initd/initd.debian b/iscsi-scst/etc/initd/initd.debian deleted file mode 100644 index aae3efecf..000000000 --- a/iscsi-scst/etc/initd/initd.debian +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh -# -# chkconfig: - 39 35 -# description: Starts and stops the iSCSI target -# debianized start-stop script - -PID_FILE=/var/run/iscsi-scstd.pid -CONFIG_FILE=/etc/iscsi-scstd.conf -DAEMON=/usr/local/sbin/iscsi-scstd - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin - -# Don't touch this "memsize thingy" unless you are blessed -# with knowledge about it. -MEM_SIZE=1048576 - -ADD_MODULES="scst_vdisk scst" - -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 - -iscsi_scstd_start() -{ - echo -n "Starting iSCSI-SCST target service: " -# configure_memsize - modprobe -q crc32c 2>/dev/null - modprobe -q crc32c-intel 2>/dev/null - modprobe iscsi-scst - for m in $ADD_MODULES; do - modprobe $m - done - start-stop-daemon --start --exec $DAEMON --quiet - /usr/local/sbin/scstadmin -config /etc/scst.conf - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - echo "succeeded." - else - echo "failed." - rmmod iscsi-scst - fi -} - -iscsi_scstd_stop() -{ - echo -n "Stopping iSCSI-SCST target service: " - start-stop-daemon --stop --quiet --exec $DAEMON --pidfile $PID_FILE - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - echo "succeeded." - else - echo "failed." - fi - # ugly, but pid file is not removed by iscsi-scstd - rm -f $PID_FILE - - echo -n "Removing iSCSI-SCST target modules: " - if [ -e /sys/module/iscsi_scst ]; then - rmmod -w iscsi-scst - fi - RETVAL=$? - for m in $ADD_MODULES; do - if [ -e /sys/module/$m ]; then - rmmod -w $m - fi - RETVAL=$? - done - modprobe -r crc32c 2>/dev/null - if [ $RETVAL -eq 0 ]; then - echo "succeeded." - else - echo "failed." - exit 1 - fi -} - -case "$1" in - start) - iscsi_scstd_start - ;; - stop) - iscsi_scstd_stop - ;; - restart) - iscsi_scstd_stop - sleep 1 - iscsi_scstd_start - ;; - status) - PID=`pidof iscsi-scstd` - if [ $PID ]; then - echo "iSCSI-SCST target is running at pid $PID" - else - echo "no iSCSI-SCST target found!" - exit 1 - fi - ;; - *) - echo $"Usage: $0 {start|stop|restart|status|dump}" - exit 1 -esac - -exit 0 diff --git a/iscsi-scst/etc/initd/initd.gentoo b/iscsi-scst/etc/initd/initd.gentoo deleted file mode 100644 index c5e9f714a..000000000 --- a/iscsi-scst/etc/initd/initd.gentoo +++ /dev/null @@ -1,78 +0,0 @@ -#!/sbin/runscript -# -# System startup script for the SCST iSCSI functionality. -# -# Customized for gentoo linux by Scott Bowe. -# -# Note: on most Linux distributions /bin/sh is a soft link to /bin/bash, while -# on a default Ubuntu setup /bin/sh is a soft link to /bin/dash ! - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin -MEM_SIZE=1048576 - -depend() -{ - use net - need scst -} - -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 -} - -start_server() -{ -# configure_memsize - modprobe -q crc32c 2>/dev/null - modprobe -q crc32c-intel 2>/dev/null - modprobe iscsi-scst - /usr/local/sbin/iscsi-scstd - /usr/local/sbin/scstadmin -config /etc/scst.conf -} - -stop_server() -{ - killall iscsi-scstd - rmmod -w iscsi-scst -} - -start() -{ - ebegin "Starting iscsi" - start_server - eend 0 -} - -stop() -{ - ebegin "Stopping iscsi" - stop_server - eend 0 -} diff --git a/iscsi-scst/etc/initd/initd.redhat b/iscsi-scst/etc/initd/initd.redhat deleted file mode 100644 index 3a1ed5399..000000000 --- a/iscsi-scst/etc/initd/initd.redhat +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/sh -# -# chkconfig: - 39 35 -# description: Starts and stops the iSCSI target -# -# pidfile: /var/run/iscsi-scstd.pid -# config: /etc/iscsi-scstd.conf - -# Source function library. -if [ -f /etc/init.d/functions ] ; then - . /etc/init.d/functions -elif [ -f /etc/rc.d/init.d/functions ] ; then - . /etc/rc.d/init.d/functions -else - exit 0 -fi - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin -MEM_SIZE=1048576 -SCST_CMD=/usr/local/sbin/scstadmin -SCST_CFG=/etc/scst.conf - -# Additional modules to load/unload -ADD_MODULES="scst_vdisk scst" - -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 - -start() -{ - echo -n "Starting iSCSI target service: " -# configure_memsize - modprobe -q crc32c 2>/dev/null - modprobe -q crc32c-intel 2>/dev/null - modprobe iscsi-scst - for module in ${ADD_MODULES}; do - modprobe ${module} - done - daemon /usr/local/sbin/iscsi-scstd - # -d 0xFFFF - /usr/local/sbin/scstadmin -config /etc/scst.conf - RETVAL=$? - echo - return $RETVAL -} - -stop() -{ - echo -n "Stopping iSCSI target service: " - killall iscsi-scstd - rmmod -w iscsi-scst - RETVAL=$? - modprobe -r crc32c 2>/dev/null - for m in ${ADD_MODULES}; do - if [ -e /sys/module/$m ]; then - rmmod $m - fi - done - if [ $RETVAL -eq 0 ]; then - echo_success - else - echo_failure - fi - echo - return $RETVAL -} - -restart() -{ - stop - start -} - -condrestart() -{ - PID=`pidofproc iscsi-scstd` - if [ $PID ]; then - restart - fi -} - -status() -{ - PID=`pidofproc iscsi-scstd` - if [ ! $PID ]; then - echo "iSCSI target stopped" - exit 1 - else - echo "iscsi-scstd (pid $PID) is running..." - fi -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - condrestart) - condrestart - ;; - status) - status - ;; - *) - echo $"Usage: $0 {start|stop|restart|status}" - exit 1 -esac - -exit $?