Hi everyone
I am currently working towards a stable iSCSI connection between Ubuntu server edition (testing with 64bit 8.04.3 LTS and 9.04) and a QNAP TS-291P.
A good basic set of instructions for iSCSI on Ubuntu 9.04 (which also works for 8.04) may be found on
HowToForge.com.
During my testing I hit on the following Bug:
boot order wrong for iscsi.
The last few postings of this thread claim that the bug was solved. However, my tests indicate the opposite!
The problem is that the
open-iscsi daemon and the resulting iSCSI connections are started before the network is started. This setup must fail since iSCSI is a network protocol.
The easy part of the fix is moving the init script for
open-iscsi further down in the boot order (as indicated by the valuable posting #15 of
the aforementioned bug report):
Code:
mv /etc/rcS.d/S25open-iscsi /etc/rcS.d/S42open-iscsi
After this modification a pre-configured connection to an iSCSI target will be established reliably during startup.
The problem, however, is the shutdown procedure.
This is the relevant excerpt from
/etc/init.d/open-iscsi:
Code:
stoptargets() {
log_daemon_msg "Disconnecting iSCSI targets"
sync
# only logout if daemon is running, iscsiadm hangs otherwise
if [ -s $PIDFILE ] && kill -0 `head -1 $PIDFILE` >/dev/null ; then
$ADM -m node --logoutall=all
fi
log_end_msg 0
}
The crucial line is:
$ADM -m node --logoutall=all
where
$ADM is replaced by
iscsiadm.
This instruction doesn't seem to work!
I also tried executing the instruction manually at the command prompt. It doesn't work either.
If, however, I explicitely logout from my QNAP iSCSI target like so:
Code:
iscsiadm -m node --targetname "xxxxxxxx" --portal "xxx.xxx.xxx.xxx" --logout
the logout works perfectly.
I also introduced the explicit logout command into
/etc/init.d/open-iscsi:
Code:
stoptargets() {
log_daemon_msg "Disconnecting iSCSI targets"
sync
# only logout if daemon is running, iscsiadm hangs otherwise
if [ -s $PIDFILE ] && kill -0 `head -1 $PIDFILE` >/dev/null ; then
iscsiadm -m node --targetname "xxxxxxxx" --portal "xxx.xxx.xxx.xxx" --logout
$ADM -m node --logoutall=all
fi
log_end_msg 0
}
This works, too.
Does anyone know, what the problem with the
--logoutall=all command might be?
Why doesn't it work?
I'm grateful for your contributions. Thanks in advance.