[Bug 1123192] Re: open-iscsi removes modules on stop but should not

Alex Bligh ubuntu at alex.org.uk
Mon Feb 18 18:30:44 UTC 2013


Just to document an IRC conversation, another more obvious instance of
the problem is:

a) use OCFS2 with a shared heartbeat service on an iSCSI connected SAN - assume this is not in the configuration file for iSCSI (not that it makes much difference)
b) OCFS2 will access the raw block device with O_DIRECT. If writes fail for a time, it will fence the machine (meaning hard reboot it)
c) Now try upgrading openiscsi. stoptargets() in the init script logs out of all targets, causing OCFS2 heartbeat writes to fail

I'm not sure how to fix this. The initiator FD appears to be owned by
iscsid. If we don't do stoptargets and the module removes in the init
script, what seems to happen is the block device (/dev/sdb) because
stale after iscsid quits and OCFS2 doesn't want to write to it anyway.
Restarting the OCFS2 cluster should fix this, but we have know way of
knowing when to do that, and we have a shortish time window or the
machine hard reboots due to kernel fencing.

What I think should happen ideally is more like the nbd client way of
doing things (and I'm just making assumptions about how iscsid works
here). That is in essence that the daemon should double fork() for each
initiated session, and that fork()'d session should ONLY exit when the
kernel is actually done with the session. Upgrading iscsid etc should
itself not kill existing sessions at all. If I understand right
(possibly not) iscsid isn't actually doing anything post negotiation,
apart from causing an issue if it dies.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/1123192

Title:
  open-iscsi removes modules on stop but should not

Status in “open-iscsi” package in Ubuntu:
  Confirmed

Bug description:
  open-iscsi's stop script has within it the following lines:

  stop() {
          stoptargets
          log_daemon_msg "Stopping iSCSI initiator service"
          start-stop-daemon --stop --quiet --signal KILL --exec $DAEMON
          rm -f $PIDFILE /lib/init/rw/sendsigs.omit.d/`basename $PIDFILE`
          modprobe -r ib_iser 2>/dev/null
          modprobe -r iscsi_tcp 2>/dev/null
          log_end_msg 0
  }

  
  The modprobe -r lines attempt to remove the relevant iscsi modules. I believe this to be a bug, because there may be other users of those modules besides open-iscsi. On an upgrade (for instance) and attempt is made to remove those modules (albeit ignoring errors), and then modprobe them back in again. However, those modules are not distributed in the open-iscsi package - they are kernel modules - and open-iscsi has no business removing them as there may be other users using them in the mean time.

  I can see no reason why they are being removed at all.

  A simple fix is to remove the two 'modprobe -r' lines from debian
  /open-iscsi.init.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1123192/+subscriptions




More information about the foundations-bugs mailing list