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

(-)a/etc/initd/boot.suse (-6 / +13 lines)
Lines 9-19 Link Here
9
# Required-Stop:
9
# Required-Stop:
10
# Should-Stop:       $null
10
# Should-Stop:       $null
11
# Default-Start:     B
11
# Default-Start:     B
12
# Default-Stop:      
12
# Default-Stop:
13
# Short-Description: iSCSI initiator daemon root-fs support
13
# Short-Description: iSCSI initiator daemon root-fs support
14
# Description:       Starts the iSCSI initiator daemon if the
14
# Description:       Starts the iSCSI initiator daemon if the
15
#                    root-filesystem is on an iSCSI device
15
#                    root-filesystem is on an iSCSI device
16
#               
16
#
17
### END INIT INFO
17
### END INIT INFO
18
18
19
ISCSIADM=/sbin/iscsiadm
19
ISCSIADM=/sbin/iscsiadm
Lines 35-53 iscsi_load_iscsiuio() Link Here
35
    TRANSPORT=`$ISCSIADM -m session 2> /dev/null | grep "bnx2i"`
35
    TRANSPORT=`$ISCSIADM -m session 2> /dev/null | grep "bnx2i"`
36
    if [ "$TRANSPORT" ] ; then
36
    if [ "$TRANSPORT" ] ; then
37
	echo -n "Launch iscsiuio "
37
	echo -n "Launch iscsiuio "
38
        startproc $ISCSIUIO
38
	startproc $ISCSIUIO
39
	rc_status -v
39
    fi
40
    fi
40
}
41
}
41
42
42
iscsi_mark_root_nodes()
43
iscsi_mark_root_nodes()
43
{
44
{
45
    echo -n "Marking iSCSI targets needed at boot time: "
46
    rc_failed 5
44
    $ISCSIADM -m session 2> /dev/null | while read t num i target ; do
47
    $ISCSIADM -m session 2> /dev/null | while read t num i target ; do
45
	ip=${i%%:*}
48
	ip=${i%%:*}
46
	STARTUP=`$ISCSIADM -m node -p $ip -T $target 2> /dev/null | grep "node.conn\[0\].startup" | cut -d' ' -f3`
49
	STARTUP=`$ISCSIADM -m node -p $ip -T $target 2> /dev/null | grep "node.conn\[0\].startup" | cut -d' ' -f3`
47
	if [ "$STARTUP" -a "$STARTUP" != "onboot" ] ; then
50
	if [ "$STARTUP" -a "$STARTUP" != "onboot" ] ; then
48
	    $ISCSIADM -m node -p $ip -T $target -o update -n node.conn[0].startup -v onboot
51
	    $ISCSIADM -m node -p $ip -T $target -o update -n node.conn[0].startup -v onboot
52
	    rc_failed 0
49
	fi
53
	fi
50
    done
54
    done
55
    rc_status -v
51
}
56
}
52
57
53
# Reset status of this service
58
# Reset status of this service
Lines 61-70 fi Link Here
61
66
62
case "$1" in
67
case "$1" in
63
    start)
68
    start)
64
	echo -n "Starting iSCSI initiator for the root device: "
65
	iscsi_load_iscsiuio
69
	iscsi_load_iscsiuio
66
	startproc $DAEMON $ARGS
70
	if ! checkproc $DAEMON ; then
67
	rc_status -v
71
	    echo -n "Starting iSCSI initiator for boot-time devices: "
72
	    startproc $DAEMON $ARGS
73
	    rc_status -v
74
	fi
68
	iscsi_mark_root_nodes
75
	iscsi_mark_root_nodes
69
	;;
76
	;;
70
    stop|restart|reload)
77
    stop|restart|reload)
(-)a/etc/initd/initd.suse (-7 / +8 lines)
Lines 9-15 Link Here
9
# Required-Stop:     $network
9
# Required-Stop:     $network
10
# Should-Stop:       multipathd
10
# Should-Stop:       multipathd
11
# Default-Start:     3 5
11
# Default-Start:     3 5
12
# Default-Stop:      
12
# Default-Stop:
13
# Short-Description: iSCSI initiator daemon
13
# Short-Description: iSCSI initiator daemon
14
# Description:       The iSCSI initator is used to create and
14
# Description:       The iSCSI initator is used to create and
15
#                    manage iSCSI connections to a iSCSI Target.
15
#                    manage iSCSI connections to a iSCSI Target.
Lines 231-237 iscsi_check_if_mounted() Link Here
231
    local dev=$1
231
    local dev=$1
232
    local d m t o x p
232
    local d m t o x p
233
233
234
    cat /proc/mounts | sed -ne '/^\/dev\/.*/p' | while read d m t o x; do 
234
    cat /proc/mounts | sed -ne '/^\/dev\/.*/p' | while read d m t o x; do
235
	if [ -L "$d" ] ; then
235
	if [ -L "$d" ] ; then
236
	    d=$(readlink -f $d)
236
	    d=$(readlink -f $d)
237
	fi
237
	fi
Lines 258-267 iscsi_check_if_mounted() Link Here
258
258
259
#
259
#
260
# Unwind block device stack
260
# Unwind block device stack
261
# 
261
#
262
# Stops unwinding if either no more 'holders'
262
# Stops unwinding if either no more 'holders'
263
# are found or if a device is mounted
263
# are found or if a device is mounted
264
# 
264
#
265
# Unmounts top-level device and deconfigures
265
# Unmounts top-level device and deconfigures
266
# all devices down the stack
266
# all devices down the stack
267
#
267
#
Lines 388-393 iscsi_list_all_nodes() Link Here
388
{
388
{
389
    # Check for active sessions
389
    # Check for active sessions
390
    if $ISCSIADM -m session > /dev/null; then
390
    if $ISCSIADM -m session > /dev/null; then
391
	echo "No active connections."
391
	return 0
392
	return 0
392
    fi
393
    fi
393
    echo "Active connections:"
394
    echo "Active connections:"
Lines 399-407 iscsi_list_all_nodes() Link Here
399
400
400
case "$1" in
401
case "$1" in
401
    start)
402
    start)
402
        echo -n "Loading iscsi modules: "
403
	echo -n "Loading iscsi modules: "
403
        iscsi_load_transport_modules
404
	iscsi_load_transport_modules
404
        rc_status -v
405
	rc_status -v
405
	if checkproc $DAEMON ; then
406
	if checkproc $DAEMON ; then
406
	    RETVAL=0
407
	    RETVAL=0
407
	else
408
	else

Return to bug 630434