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

Alkis Georgopoulos <[email protected]> Fri, 24 Sep 2010 13:58:12 +0300
Newsgroups gmane.linux.terminal-server.devel
Message-ID <1285325892.1481.0.camel@alkis>
Thank you all for your feedback, committed in
http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/1777#client/initramfs/scripts/ltsp_nbd


Στις 15-09-2010, ημέρα Τετ, και ώρα 17:29 +0530, ο/η Jigish Gohil
έγραψε:
> On Wed, Sep 15, 2010 at 5:27 PM, Jigish Gohil <[email protected]> wrote:
> >
> > This is what kiwi's linuxrc does, pasting relevant parts here:
> >
> 
> Missed this one:
> 
> function udevPending {
>         local timeout=30
>         if [ -x /sbin/udevadm ];then
>                 /sbin/udevadm trigger
>                 /sbin/udevadm settle --timeout=$timeout
>         else
>                 /sbin/udevtrigger
>                 /sbin/udevsettle --timeout=$timeout
>         fi
> }
> 
> > #======================================
> > # 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




------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_____________________________________________________________________
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