Re: ltsp_nbd: work around some udev/upstart issues?

Jigish Gohil <[email protected]> Wed, 15 Sep 2010 17:27:21 +0530
Newsgroups gmane.linux.terminal-server.devel
Message-ID <[email protected]>
On Wed, Sep 15, 2010 at 5:16 PM, Michael Shigorin <[email protected]> wrote:
> On Wed, Sep 15, 2010 at 11:34:05AM +0300, Alkis Georgopoulos wrote:
>> I've had reports of fast clients not booting, possibly because of udev
>> or upstart problems, and with the following patch they were solved.
>
> OTOH just in case, in case of fast clients which are device-rich,
> modest tmpfs size/inodes might become insufficient (it was a real
> bugreport with one-line patch which fixed the trouble for them).
>
> https://bugzilla.altlinux.org/show_bug.cgi?id=23608
> https://attachments.bugzilla.altlinux.org/attachment.cgi?id=4425
>
>> It just makes nbd-client retry connecting up to 10 times, if it fails.
>> On the problematic clients, it succeeds on the 2-4 try.
>
> If the problem is with udev not yet done with devices by the time
> nbd tries to use them, maybe calling err... "udevadm settle"
> before nbd-client might help.  Just guessing though.

This is what kiwi's linuxrc does, pasting relevant parts here:

#======================================
# waitForBlockDevice
#--------------------------------------
function waitForBlockDevice {
        # /.../
        # function to check if the given block device
        # exists. If not the function will wait until the
        # device appears or the check counter equals 4
        # ----
        local device=$1
        local check=0
        udevPending
        while true;do
                if [ -b $device ] || [ $check -eq 4 ];then
                        break
                fi
                Echo "Waiting for device $device to settle..."
                check=`expr $check + 1`
                sleep 2
        done
}

 if [ -z "$nbdDevice" ];then
                        nbdDevice="/dev/nbd0"
 fi

waitForBlockDevice $nbdDevice

 Echo "Mounting NBD root system: $nbdServer $nbdPort [$nbdDevice]..."
 if ! nbd-client $nbdServer $nbdPort $nbdDevice -persist;then
                 systemException "Failed to setup $nbdDevice device" "reboot"
 fi

Full code here: http://git.berlios.de/cgi-bin/gitweb.cgi?p=kiwi;a=summary

Cheers

-J

>
>> -    if nbd-client $NBD_CLIENT_ROOT_SERVER $NBD_ROOT_PORT /dev/nbd0 ; then
>> +    # Try up to 10 times with 2 sec interval because of udev/upstart bugs
>

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_____________________________________________________________________
Ltsp-developer mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-developer
For additional LTSP help,   try #ltsp channel on irc.freenode.net