summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2011-06-21 11:23:08 +0200
committerMike Christie <michaelc@cs.wisc.edu>2011-06-26 17:53:03 -0500
commit5b84f2e6b527ee3c60948e508ae3751a5683bc9c (patch)
tree51703199eeeb72020b16e0f2805b957eba290279 /etc
parentc44bdb5af6ac232adde2390990e96220d642e43d (diff)
downloadopen-iscsi-5b84f2e6b527ee3c60948e508ae3751a5683bc9c.tar.gz
boot.suse: Update with latest fixes
Include latest fixes from SUSE. Signed-off-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'etc')
-rw-r--r--etc/initd/boot.suse35
1 files changed, 15 insertions, 20 deletions
diff --git a/etc/initd/boot.suse b/etc/initd/boot.suse
index df64e21..ac6abcc 100644
--- a/etc/initd/boot.suse
+++ b/etc/initd/boot.suse
@@ -4,36 +4,37 @@
#
### BEGIN INIT INFO
# Provides: iscsiboot
-# Required-Start: boot.proc
-# Should-Start:
-# Required-Stop:
+# Required-Start:
+# Should-Start: boot.multipath
+# Required-Stop:
# Should-Stop:
# Default-Start: B
# Default-Stop:
-# Short-Description: Starts the iSCSI initiator daemon
-#
+# Short-Description: iSCSI initiator daemon root-fs support
+# Description: Starts the iSCSI initiator daemon if the
+# root-filesystem is on an iSCSI device
+#
### END INIT INFO
ISCSIADM=/sbin/iscsiadm
-PID_FILE=/var/run/iscsi.pid
CONFIG_FILE=/etc/iscsid.conf
DAEMON=/sbin/iscsid
-ARGS="-c $CONFIG_FILE -p $PID_FILE"
+ARGS="-c $CONFIG_FILE"
# Source LSB init functions
. /etc/rc.status
#
-# This service is run right after booting. So all activated targets
-# must be enabled during mkinitrd run and thus should not be removed
-# when the open-iscsi service is stopped.
+# This service is run right after booting. So all targets activated
+# during mkinitrd run should not be removed when the open-iscsi
+# service is stopped.
#
iscsi_mark_root_nodes()
{
$ISCSIADM -m session 2> /dev/null | while read t num i target ; do
ip=${i%%:*}
- STARTUP=`$ISCSIADM -m node -p $ip -T $target | grep "node.conn\[0\].startup" | cut -d' ' -f3`
- if [ "$STARTUP" != "onboot" ] ; then
+ STARTUP=`$ISCSIADM -m node -p $ip -T $target 2> /dev/null | grep "node.conn\[0\].startup" | cut -d' ' -f3`
+ if [ "$STARTUP" -a "$STARTUP" != "onboot" ] ; then
$ISCSIADM -m node -p $ip -T $target -o update -n node.conn[0].startup -v onboot
fi
done
@@ -50,13 +51,12 @@ fi
case "$1" in
start)
- [ ! -d /var/lib/open-iscsi ] && mkdir -p /var/lib/open-iscsi
echo -n "Starting iSCSI initiator for the root device: "
startproc $DAEMON $ARGS
rc_status -v
iscsi_mark_root_nodes
;;
- stop)
+ stop|restart|reload)
rc_failed 0
;;
status)
@@ -68,13 +68,8 @@ case "$1" in
rc_status -v
fi
;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
*)
- echo "Usage: $0 {start|stop|status|restart}"
+ echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac