[Pkg-iscsi-maintainers] Bug#705031: base: netdev boot sequence problem and possible fix
Holger Levsen
holger at layer-acht.org
Tue Apr 9 08:24:56 UTC 2013
reassign 705031open-iscsi
thanks
On Dienstag, 9. April 2013, Dennis Leeuw wrote:
> Package: base
> Severity: important
>
> When using iSCSI devices with multipathd, the open-iscsi boot script is
> started before multipathd, hence the system tries to mount _netdev devices
> before multipath is up-and-running. Thus my iSCSI devices are not mounted
> at boot time and need thus be mounted manualy, which is not a handy thing
> to do for /home
>
> I created a new script called /etc/init.d/mountnetdev, which can be run
> with start|stop to mount/umount all _netdev devices or one can use the
> stop with a subsystem to stop only part of the mounts.
>
> One important note: the script is in a very early stage, and still requires
> bash since dash does not support ${var:x:y}. In the open-iscsi script I
> replaced umountiscsi.sh with: mountnetdev stop iscsi
>
> In /etc/rc2.d I created a symlink S23z-mountnetdev so the script is started
> at boot after all _netdev required daemons are started.
>
> Hope this helps to make Debian an even better distro.
>
> Greetings,
>
> Dennis Leeuw
>
> Script:
> #! /bin/bash
> ### BEGIN INIT INFO
> # Provides: mountnetdev
> # Required-Start:
> # Required-Stop:
> # Should-Start: $network
> # Default-Start: S
> # Default-Stop:
> # Short-Description: Wait for network file systems to be mounted
> # Description: Mount and umount _netdev marked filesystems
> ### END INIT INFO
>
> . /lib/init/vars.sh
> . /lib/lsb/init-functions
>
> do_stop_subsys() {
> local mountpnt=""
> local device=""
> local syspath=""
> case $1 in
> iscsi)
> # It can be a multipath device
> # a LVM device
> # a plain ISCSI disk
> # FIXME make sure /etc/fstab is there
> for mountpnt in `grep _netdev /etc/fstab | cut -d' ' -f1 | cut -d" "
> -f1`; do # Strip trailing /
> device=${mountpnt%/}
> # Strip path
> device=${device##*/}
> # Strip part
> device=${device%-*}
>
> # Check to see if it is a multipath device, very basic check
> if [ "${device:0:5}" = "mpath" ]; then
> # It's a multipath device: get the active path's disk
> device=`multipath -l $device | grep -A1 status=active | tail -1
| cut
> -d' ' -f4` fi
>
> # FIXME make sure /sys/ is mounted
> # Find the disk in /sys/
> syspath=`find /sys/ -name "$device"`
> syspath=${syspath%/session*}
>
> # See if it has iscsi_host set
> if [ -e ${syspath}/iscsi_host ]; then
> log_daemon_msg "Unmounting iscsi filesystem ${mountpnt}"
> UMOUNT_RESULT=1
> if umount ${mountpnt} >/dev/null 2>&1; then
> UMOUNT_RESULT=0
> fi
> log_end_msg $UMOUNT_RESULT
> fi
>
> done
> ;;
> esac
> }
>
> case "$1" in
> start)
> # Let's mount
> log_daemon_msg "Mounting _netdev filesystems"
> MOUNT_RESULT=1
> if mount -a -O _netdev >/dev/null 2>&1; then
> MOUNT_RESULT=0
> fi
> log_end_msg $MOUNT_RESULT
> ;;
> restart|reload|force-reload)
> echo "Error: argument '$1' not supported" >&2
> exit 3
> ;;
> stop)
> if [ "$2" = "" ]; then
> # Let's umount
> log_daemon_msg "Unmounting _netdev filesystems "
> UMOUNT_RESULT=1
> if umount -a -O _netdev >/dev/null 2>&1; then
> UMOUNT_RESULT=0
> fi
> log_end_msg $UMOUNT_RESULT
> else
> do_stop_subsys $2
> fi
> ;;
> *)
> echo "Usage: $0 start|stop" >&2
> exit 3
> ;;
> esac
>
> : exit 0
>
> -- System Information:
> Debian Release: 6.0.7
> 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
>
> ---------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-iscsi-maintainers/attachments/20130409/7c987fd7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-iscsi-maintainers/attachments/20130409/7c987fd7/attachment-0001.pgp>
More information about the Pkg-iscsi-maintainers
mailing list