View | Details | Raw Unified | Return to bug 630434
Collapse All | Expand All

(-)open-iscsi-2.0.871-0.29.1/etc/init.d/boot.open-iscsi (-5 / +11 lines)
Lines 31-41 Link Here
31
#
31
#
32
iscsi_mark_root_nodes()
32
iscsi_mark_root_nodes()
33
{
33
{
34
    rc_failed 5
34
    $ISCSIADM -m session 2> /dev/null | while read t num i target ; do
35
    $ISCSIADM -m session 2> /dev/null | while read t num i target ; do
35
	ip=${i%%:*}
36
	ip=${i%%:*}
36
	STARTUP=`$ISCSIADM -m node -p $ip -T $target 2> /dev/null | grep "node.conn\[0\].startup" | cut -d' ' -f3`
37
	STARTUP=`$ISCSIADM -m node -p $ip -T $target 2> /dev/null | grep "node.conn\[0\].startup" | cut -d' ' -f3`
37
	if [ "$STARTUP" -a "$STARTUP" != "onboot" ] ; then
38
	if [ "$STARTUP" -a "$STARTUP" != "onboot" ] ; then
38
	    $ISCSIADM -m node -p $ip -T $target -o update -n node.conn[0].startup -v onboot
39
	    $ISCSIADM -m node -p $ip -T $target -o update -n node.conn[0].startup -v onboot
40
	    rc_failed 0
39
	fi
41
	fi
40
    done
42
    done
41
}
43
}
Lines 43-49 Link Here
43
# Reset status of this service
45
# Reset status of this service
44
rc_reset
46
rc_reset
45
47
46
# We only need to start this for root on iSCSI
48
# We only need to run this, if the iSCSI stack has already been loaded
47
if ! grep -q iscsi_tcp /proc/modules ; then
49
if ! grep -q iscsi_tcp /proc/modules ; then
48
    rc_failed 6
50
    rc_failed 6
49
    rc_exit
51
    rc_exit
Lines 51-60 Link Here
51
53
52
case "$1" in
54
case "$1" in
53
    start)
55
    start)
54
	echo -n "Starting iSCSI initiator for the root device: "
56
	if ! checkproc $DAEMON
55
	startproc $DAEMON $ARGS
57
	then
56
	rc_status -v
58
	    echo -n "Starting iSCSI initiator for the root device: "
59
	    startproc $DAEMON $ARGS
60
	    rc_status -v
61
	fi
62
	echo -n "Marking iSCSI targets as needed iSCSI devices at boot up time: "
57
	iscsi_mark_root_nodes
63
	iscsi_mark_root_nodes
64
	rc_status -v
58
	;;
65
	;;
59
    stop|restart|reload)
66
    stop|restart|reload)
60
	rc_failed 0
67
	rc_failed 0
Lines 74-77 Link Here
74
	;;
81
	;;
75
esac
82
esac
76
rc_exit
83
rc_exit
77

Return to bug 630434