nbd swap server, inetd, SO_KEEPALIVE
Gavin McCullagh
gmccullagh at gmail.com
Tue May 8 09:44:15 UTC 2007
Hi,
while at UES, Scott, Matt and I had a look into nbd server leaving lots of
processes and dead files hanging around and concluded that the TCP option
SO_KEEPALIVE needs to be added to the connection. After some looking it
was concluded that inetd is the place to do this and Scott wrote a short
patch to implement this which successfully dropped the nbd-server
connection if the client went away.
I've spoken to a colleague here and consulted UNIX Network Programming
(Stevens) and it seems that any program with access to the socket can set
SO_KEEPALIVE at any point during the lifetime of the connection. This
seems to imply that nbd-server can turn on SO_KEEPALIVE even though inetd
is starting it. Looking at the nbd-server code suggests either that the
author wasn't aware of that or thought it better to let inetd do it.
There seem to be arguments for patching inetd to set SO_KEEPALIVE (so you
can turn it on even if your server program doesn't do it) and for patching
nbd-server to turn it on (it certainly does turn it on when not called by
inetd). I could be wrong, but I imagine it might be easier to get the
patch upstream in nbd-server.
It's even possible I suspect to set SO_KEEPALIVE within Vagrant's shell
script wrapper which inetd calls directly.
Any thoughts?
Gavin
More information about the edubuntu-devel
mailing list