LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-30-2009, 09:30 AM   #1
windstrewn
LQ Newbie
 
Registered: Oct 2007
Location: Switzerland
Distribution: Debian, Ubuntu
Posts: 10

Rep: Reputation: 0
Post iSCSI on Ubuntu: working around boot order problems


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.
 
Old 10-02-2009, 12:33 AM   #2
tapke
LQ Newbie
 
Registered: Jun 2008
Posts: 13

Rep: Reputation: 0
When you tried:
Code:
iscsiadm -m node --logout--all
Did it give any message?

Last edited by tapke; 10-02-2009 at 12:34 AM.
 
Old 10-02-2009, 12:37 AM   #3
tapke
LQ Newbie
 
Registered: Jun 2008
Posts: 13

Rep: Reputation: 0
Quote:
-U, --logoutall==[all,manual,automatic]
logout all sessions with the node or conn startup values passed in or all running sesssion, except ones marked onboot, if all is passed in.
This option is only valid for node mode (it is valid but not functional for session mode).
I believe *except ones marked onboot* should be the problem.
 
Old 10-05-2009, 12:49 AM   #4
windstrewn
LQ Newbie
 
Registered: Oct 2007
Location: Switzerland
Distribution: Debian, Ubuntu
Posts: 10

Original Poster
Rep: Reputation: 0
> Did it give any message?

No, that's one of the strange things. I couldn't find any special messages in the logs, nor did I get a message on the command line when typing the command directly.

> I believe *except ones marked onboot* should be the problem.

I did see this line in the manpage. However, the command was introduced into the init scripts by the Debian people... Do I know more about init scripts than them? - No, definitely not.
Yes, it is possible that this is the problem. I consider it unlikely, though.


Thank you for your replies.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't install and use iscsi initiator and target on ubuntu 8.10, who can help me? nicegiving Linux - Software 1 05-22-2009 10:01 AM
problem in ISCSi and RAID not working properly vaibhavp Linux - Software 1 06-19-2008 10:40 AM
changes on other iscsi nodes attached to an ext3 iscsi target not being seen sldahlin Linux - Server 1 06-07-2008 02:02 AM
Cant boot with ISCSI on jesste SUSE / openSUSE 0 07-25-2007 08:58 AM
Have to change boot order in BIOS to boot ubuntu/winxp Minn3h Linux - Software 7 04-01-2006 05:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration