[Pkg-iscsi-maintainers] Bug#809334: Bug#809334: Bug#809320: open-iscsi: no session termination on stop

Christian Seiler christian at iwakd.de
Wed Dec 30 12:34:47 UTC 2015


On 12/30/2015 12:35 PM, Ritesh Raj Sarraf wrote:
> But the change you've proposed has other repercussion. It breaks
> shutdown, because now, iscsi service/sessions are terminated way early.
> This leaves, effectively, a hung sanboot system.
> 
> Please see attached images.
> 
> I also didn't like that iscsi shutdown, even thought my rootfs was
> running.
> 
> I'll keep digging.

Ok, so I think there's two things going on here: a problem in a
change I made in that doesn't work in your specific configuration
(which we should debug) and a general question about how to
handle shutdown.

First of all: the fact that iSCSI volumes are shut down is a
change I made on purpose. There are two parts to this: first of
all, iscsid is going to be killed anyway,[*] but the kernel will
keep running sessions open regardless (unless there's an error
with the connection / the target). Secondly, which is the change
I did make, is that iSCSI sessions are logged out on shutdown
regardless of whether the rootfs is on iSCSI. I did that because
I think it is still correct to log out of sessions that the
rootfs is NOT on, because we want to cleanly logout of anything
that is possible to log out of. There is a flag in
/etc/default/open-iscsi to return to the old behavior, this is
also mentioned in the NEWS file, which is shown on updates, but
not on new installs. Note that this does not include the rootfs
sessions - they SHOULD be excluded. (Of course, if you disagree
with this change and think ALL sessions, not just the rootfs
sessions, should be kept open by default, we could discuss this
separately.)

Now for the problem in your case: there is code in the open-iscsi
package in unstable that tries to make sure we don't close
sessions where the rootfs is on. This consists of two steps:

1) /lib/open-iscsi/umountiscsi.sh [#] will try to umount
filesystems on iSCSI. At the same time it detects sessions that
contain the root filesystem and writes them out into the file
/run/open-iscsi/shutdown-keep-sessions.

2) /lib/open-iscsi/logout-all.sh [~] will detect if the file
/run/open-iscsi/shutdown-keep-sessions exists - and if it does
it will *NOT* run the default iscsiadm -m node --logoutall=all
but rather log out of all sessions that were not excluded.

So what happens in your case is that umountiscsi.sh likely
doesn't properly detect your setup where your rootfs is on
iSCSI - and therefore doesn't exclude the relevant sessions
from logout.

To test this, you should run the /lib/open-iscsi/umountiscsi.sh
script manually - that should *not* try to umount anything
(because it should detect that it's the rootfs) and write out
/run/open-iscsi/shutdown-keep-sessions. You should check that
that file contains all the sessions that your rootfs relies
on.

Hope that gives you enough pointers to debug this.

Regards,
Christian

[*] systemd tracks processes, so it's going to be killed. There
is a possibility to avoid this, but this requires changes to
iscsid and will be rather complicated to get the integration
right. Not saying we shouldn't consider this, but just saying
that's complicated, and is something that's much lower on my
TODO list.

[#] http://anonscm.debian.org/cgit/pkg-iscsi/open-iscsi.git/tree/debian/extra/umountiscsi.sh

[~] http://anonscm.debian.org/cgit/pkg-iscsi/open-iscsi.git/tree/debian/extra/logout-all.sh

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-iscsi-maintainers/attachments/20151230/2fcf7dd8/attachment-0001.sig>


More information about the Pkg-iscsi-maintainers mailing list