Tryag File Manager
Home
-
Turbo Force
Current Path :
/
etc
/
init.d
/
Upload File :
New :
File
Dir
//etc/init.d/iscsid
#!/bin/sh # # chkconfig: 345 7 89 # description: Starts and stops the iSCSI daemon. # # processname: iscsid # pidfile: /var/run/iscsid.pid # config: /etc/iscsi/iscsid.conf # Source function library. . /etc/init.d/functions PATH=/sbin:/bin:/usr/sbin:/usr/bin RETVAL=0 start() { echo -n $"Starting iSCSI daemon: " modprobe -q cxgb3i modprobe -q bnx2i modprobe -q iscsi_tcp modprobe -q ib_iser modprobe -q be2iscsi daemon iscsiuio daemon iscsid RETVAL=$? echo [ $RETVAL -eq 0 ] || return touch /var/lock/subsys/iscsid success echo } stop() { rm -f /var/lock/subsys/iscsid # If this is a final shutdown/halt, do nothing since # we may need iscsid for as long as possible (halt script kills # us at the last second) if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then success return fi # don't turn off iscsi if root is possibly on a iscsi disk rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) if [[ "$rootopts" =~ "_netdev" ]] ; then echo $"Can not shutdown iSCSI. Root is on a iSCSI disk." exit 1 fi echo -n $"Stopping iSCSI daemon: " iscsiadm -k 0 echo killproc iscsiuio rm -f /var/run/iscsiuio.pid rm -f /var/run/iscsid.pid # only remove the iscsi drivers when offload is used rmmod be2iscsi 2>/dev/null rmmod bnx2i 2>/dev/null rmmod cnic 2>/dev/null rmmod cxgb3i 2>/dev/null modprobe -r ib_iser 2>/dev/null modprobe -r iscsi_tcp 2>/dev/null } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) status iscsid RETVAL=$? ;; condrestart) [ -f /var/lock/subsys/iscsid ] && restart ;; *) echo $"Usage: $0 {start|stop|restart|status|condrestart}" exit 1 esac exit $RETVAL