[Pkg-iscsi-maintainers] Bug#691732: open-iscsi: umountiscsi.sh tries to umount / and /var

Dennis Leeuw d.leeuw at umcutrecht.nl
Mon Oct 29 09:17:31 UTC 2012


Package: open-iscsi
Version: 2.0.871.3-2squeeze1
Severity: important
Tags: patch

Due to the fact that our system does not receive block devices from the iSCSI target, but it is logged in,
this means the the BLOCK_FILE contains the search string, since /block/ does not exist. It then tries to umount
everything, making the entire system read-only :(

With the change I made in umountiscsi.sh this is not happening anymore.

Greetings,

Dennis Leeuw

-- System Information:
Debian Release: 6.0.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages open-iscsi depends on:
ii  libc6                         2.11.3-4   Embedded GNU C Library: Shared lib
ii  udev                          164-3      /dev/ and hotplug management daemo

open-iscsi recommends no packages.

open-iscsi suggests no packages.

-- Configuration Files:
/etc/default/open-iscsi changed:
LVMGROUPS="md3200_1"
HANDLE_NETDEV=1

/etc/init.d/umountiscsi.sh changed:
. /lib/init/vars.sh
. /lib/lsb/init-functions
if [ -f /etc/default/open-iscsi ]; then
	. /etc/default/open-iscsi
fi
do_stop () {
    log_daemon_msg "Unmounting iscsi-backed filesystems"
    umount_fail=0
    if [ $HANDLE_NETDEV -eq 1 ]; then
	    log_progress_msg "Unmounting all devices marked _netdev";
	    umount -a -O _netdev >/dev/null 2>&1
    fi
    # Now handle iSCSI LVM Volumes
    if [ -n "$LVMGROUPS" ]; then
    	log_daemon_msg "Deactivating iSCSI volume groups"
    	for vg in "$LVMGROUPS"; do
    		log_progress_msg $vg
    		vgchange --available=n $vg
		if [ $? -ne 0 ]; then
			log_warning_msg "Cannot deactivate Volume Group $vg"
			umount_fail=1
		fi
    	done
    	log_end_msg 0
    fi
    for HOST_DIR in /sys/devices/platform/host*; do
	if ! [ -d $HOST_DIR/iscsi_host* ]; then
	    continue
	fi
        for SESSION_DIR in $HOST_DIR/session*; do
		if ! [ -d $SESSION_DIR/target* ]; then
			continue
		fi
		for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do
                        if [ "${BLOCK_FILE}" = '/sys/devices/platform/host24/session20/target*/*:*/block/*' ]; then
                                log_warning_msg "No block devices found for this host"
                                return 1
                        fi
			BLOCK_DEV=`echo "$BLOCK_FILE" | sed 's/.*block\///'`
			DOS_PARTITIONS="`awk "/^\/dev\/$BLOCK_DEV/ { print \\$2; }" < /proc/mounts`"
			for DEVICE in $DOS_PARTITIONS; do
				#log_progress_msg $DEVICE
				#echo $DEVICE
				umount $DEVICE
				exit_status=$?
				if ! [ $exit_status -eq 0 ]; then
					umount_fail=1
					log_warning_msg "Could not unmount $DEVICE"
				fi
			done
		done
	done
    done
    if [ $umount_fail -ne 0 ]; then
	    log_end_msg 1
	    exit 1
    else
	    log_end_msg 0
	    exit 0
    fi
}
case "$1" in
    start)
	# No-op
        ;;
    restart|reload|force-reload)
	echo "Error: argument '$1' not supported" >&2
	exit 3
	;;
    stop|"")
        do_stop
	;;
    *)
        echo "Usage: umountiscsi.sh [start|stop]" >&2
	exit 3
	;;
esac

/etc/iscsi/initiatorname.iscsi changed:
InitiatorName=iqn.2005-03.org.open-iscsi:es

/etc/iscsi/iscsid.conf changed:
node.startup = automatic
node.session.auth.authmethod = None
node.session.timeo.replacement_timeout = 144
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.noop_out_interval = 10
node.conn[0].timeo.noop_out_timeout = 15
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 20
node.session.initial_login_retry_max = 8
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.xmit_thread_priority = -20
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.conn[0].iscsi.MaxRecvDataSegmentLength = 65535
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.DataDigest = None
node.session.iscsi.FastAbort = Yes


-- no debconf information

------------------------------------------------------------------------------

De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren. Het Universitair Medisch
Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
(Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.

Denk s.v.p aan het milieu voor u deze e-mail afdrukt.

------------------------------------------------------------------------------

This message may contain confidential information and is intended exclusively
for the addressee. If you receive this message unintentionally, please do not
use the contents but notify the sender immediately by return e-mail. University
Medical Center Utrecht is a legal person by public law and is registered at
the Chamber of Commerce for Midden-Nederland under no. 30244197.

Please consider the environment before printing this e-mail.



More information about the Pkg-iscsi-maintainers mailing list