Hi Mike, >>> You should not have to logout the session. For Red Hat and I think >>> SLES, when the system is shutting down the root FS gets mounted as >>> read-only. iSCSI is left running. Eventually /sbin/shutdown is run and >>> from there the kernel is shutdown and if needed the scsi layer might >>> have the iscsi layer send some commands like a sync cache. So for this >>> you just need to leave the network up. >> >> I did some research today around this. For Debian, yes, the root FS will >> be remounted as read-only before shutting down/rebooting. However, the >> system will then stuck at sync cache, even I have left network running. >> I have not looked into the Linux kernel to check whether iscsi layer >> will send logout command to the target, but I highly suspect it won't. > > It will not logout of the target at this time. It cannot because > userspace is shutdown and iscsid is what sends the logout request. > > A logout is *not* needed though. It is not what is causing your problem. > > For RHEL/OEL and SUSE we do not send a logout and it works fine.
The reason I need the logout operation is not only limited to a gracefully shutdown. I also want to have the tgt side have a clean record for the target. >> Here is what I am going to propose: >> >> 1. I am now trying to extend iscsistart to be capable send logout >> command. >> 2. In runlevel 0 and runlevel 6, after remounting the root FS as >> read-only, use pivot_root and chroot to change the root to a ramfs, >> similar to initramfs, which is loaded with iscsistart. Then we can >> logout gracefully by invoking iscsistart. >> >> Please let me know what do you think of this. >> > > It is nice to logout but it is not going to fix your problem. > > If you are getting stuck at the sync cache stage then your network > probably went down. /sbin/shutdown probably shutdown the network on you. I guess so. Before hitting /sbin/shutdown and right after remount root FS as read-only, the network is still up. So I guess /sbin/shutdown might be the problem. Cheng -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscr...@googlegroups.com. To post to this group, send email to open-iscsi@googlegroups.com. Visit this group at http://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/d/optout.