⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initd.redhat

📁 iscsi企业级target.很好用
💻 REDHAT
字号:
#!/bin/sh## chkconfig: - 39 35# description: Starts and stops the iSCSI target## pidfile: /var/run/ietd.pid# config:  /etc/ietd.conf# Source function library.if [ -f /etc/init.d/functions ] ; then  . /etc/init.d/functionselif [ -f /etc/rc.d/init.d/functions ] ; then  . /etc/rc.d/init.d/functionselse  exit 0fiPATH=/sbin:/bin:/usr/sbin:/usr/binMEM_SIZE=1048576configure_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=0start(){	echo -n "Starting iSCSI target service: "	configure_memsize	modprobe -q crc32c	modprobe iscsi_trgt	daemon /usr/sbin/ietd	RETVAL=$?	echo	return $RETVAL}	stop(){	echo -n "Stoping iSCSI target service: "	ietadm --op delete >/dev/null 2>/dev/null	killall ietd 2> /dev/null	modprobe -r iscsi_trgt 2>/dev/null	RETVAL=$?	modprobe -r crc32c 2>/dev/null	if [ $RETVAL == "0" ]; then		echo_success	else		echo_failure	fi	echo	return $RETVAL}restart(){        stop        start}status(){	PID=`pidofproc ietd`	if [ ! $PID ]; then		echo "iSCSI target stopped"		exit 1	else		echo "ietd (pid $PID) is running..."	fi	}case "$1" in  start)        start        ;;  stop)        stop        ;;  restart)        restart        ;;  status)        status        ;;  *)        echo $"Usage: $0 {start|stop|restart|status}"        exit 1esacexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -