Op woensdag 16 juli 2014 12:01:54 schreef Santiago Villafuerte:
> Hello
>
> I am running Linux 2.6.31 on an iMX25 from Freescale. We have the nbd-server
> binary (2.9.23 apparently) and we run this command:
>
> /usr/local/bin/nbd-server
9000 /dev/sda1
>
>
> If an ethernet interface is active in Linux (eth0 or usb0), the nbd-server
> stays alive and netstat shows the LISTENING status of the 9000 port:
>
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address Foreign Address State
> tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN
>
>
> However, when there is no available interface up in the system (only
> localhost -loopback), and the nbd-server is started, it won't stay active
> at all. The netstat -al command does
not show the 9000 port as active.
So, it looks like that's a bug which only triggers when you want to do
oldstyle negotiation. The "tests on the train" that I talked about were
invalid, because I forgot that I have a tap0 interface active at all
time for communication with virtual machines.
Of course that shouldn't happen; I can't look at it in detail right now,
but I have a fairly good idea where the problem most likely is. However,
the workaround is fairly simple: Don't use oldstyle negotiation, use
newstyle negotiation. That's a good idea for more reasons than just
making your problem go away:
- It's easier to use on the client side (you need to remember an export
name rather than a port number)
- It will continue working
(oldstyle has been deprecated for a fair
while now, and I'm seriously considering dropping support for it some
time soon)
To be able to use newstyle, all you need to do is create a config file
and start nbd-server without arguments. There's a few examples in the
README file that show you how to do it.
Regards,
--
It is easy to love a country that is famous for chocolate and beer
-- Barack Obama, speaking in Brussels, Belgium, 2014-03-26