Doron Shoham wrote:
> While stopping open-iscsi, the initd script removes
> the modules by running 'modprobe -r'. The retval of
> modprobe must be tested.
> 
> Signed-off-by: Doron Shoham <[EMAIL PROTECTED]>
> ---
>  etc/initd/initd.debian |    9 ++++++++-
>  etc/initd/initd.redhat |   13 ++++++++++++-
>  etc/initd/initd.suse   |    9 ++++++++-
>  3 files changed, 28 insertions(+), 3 deletions(-)
> 
> diff --git a/etc/initd/initd.debian b/etc/initd/initd.debian
> index 9e9f134..00b644e 100644
> --- a/etc/initd/initd.debian
> +++ b/etc/initd/initd.debian
> @@ -54,9 +54,16 @@ stop() {
>       log_daemon_msg "Stopping iSCSI initiator service"
>       start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
>       rm -f $PIDFILE
> +     status=0
>       modprobe -r ib_iser 2>/dev/null
> +     if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
> +             status=1
> +     fi
>       modprobe -r iscsi_tcp 2>/dev/null
> -     log_end_msg 0
> +     if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
> +             status=1
> +     fi
> +     log_end_msg $status
>  }
>  
>  restart() {
> diff --git a/etc/initd/initd.redhat b/etc/initd/initd.redhat
> index 7cf198e..d68f135 100644
> --- a/etc/initd/initd.redhat
> +++ b/etc/initd/initd.redhat
> @@ -42,9 +42,20 @@ stop()
>       killproc iscsid
>       rm -f /var/run/iscsid.pid
>       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-iscsi
> +     status=0
>       modprobe -r iscsi_tcp 2>/dev/null
> +     if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
> +             status=1
> +     fi
>       modprobe -r ib_iser 2>/dev/null
> -     success
> +     if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
> +             status=1
> +     fi
> +     if [ "$status" -eq "0" ]; then
> +             success
> +     else
> +             failure
> +     fi
>       echo
>  
>  }
> diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
> index 163479e..f5009d2 100644
> --- a/etc/initd/initd.suse
> +++ b/etc/initd/initd.suse
> @@ -88,9 +88,16 @@ case "$1" in
>       echo -n "Stopping iSCSI initiator service: "
>       if [ "$RETVAL" == "0" ]; then
>           rm -f $PID_FILE
> +         status=0
>           modprobe -r iscsi_tcp
> +         if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
> +             status=1
> +         fi
>           modprobe -q -r ib_iser
> -         rc_failed 0
> +            if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
> +             status=1 
> +            fi
> +         rc_failed $status
>       else
>           rc_failed 1
>       fi
Ho-hum.

Why do we have to unload the modules here?
Of course it's nice and proper in theory, but you get
a nice crash when running multipath over iscsi.
As iscsi is stopped prior to multipathing it's okay
to shutdown the daemon (as the connection will still be
functioning).
But as there's still a multipath map on these devices
(ie bd_claim is set) the sysfs / driver core objects
won't be removed but having invalid function pointers
instead.
Nice crash, that one.

So can't we just leave the modules as they are?
They don't do any harm during shutdown, now do they?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                   zSeries & Storage
[EMAIL PROTECTED]                             +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to