3 # iscsi This shell script takes care of starting and stopping iscsi.
5 # chkconfig: 2345 11 20
6 # description: Start iSCSI to allow access to remote SCSI devices
8 # pidfile: /var/run/iscsid.pid
10 # Source function library.
11 . /etc/rc.d/init.d/functions
13 # Source networking configuration.
14 . /etc/sysconfig/network
16 # Source oident configureation.
17 if [ -f /etc/sysconfig/iscsi ]; then
18 . /etc/sysconfig/iscsi
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24 msg_network_down "iSCSI Initiator"
31 [ -z "$ISCSI_CONNFAILTIMEOUT" ] && ISCSI_CONNFAILTIMEOUT=30
34 # See how we were called.
38 if [ ! -f /var/lock/subsys/iscsid ]; then
39 msg_starting "iSCSI Initiator"
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/iscsid
44 msg_already_running "iSCSI Initiator"
49 if [ -f /var/lock/subsys/iscsid ]; then
50 msg_stopping "iSCSI Initiator"
52 rm -f /var/lock/subsys/iscsid >/dev/null 2>&1
54 msg_not_running "iSCSI Initiator"
71 msg_usage "$0 {start|stop|restart|force-reload|status}"