|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/etc/rc6.d/ |
Upload File : |
#!/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