[clue-tech] sendfile(2) doesn't work with unionfs.

David L. Anselmi anselmi at anselmi.us
Sat Dec 2 14:25:09 MST 2006


Talk about two steps forward, one step back.  My latest effort on a 
server to provide netboot installs is getting Debian to install.

I've managed to get the repository built correctly, it seems, but the 
installer complains about not being able to get the udebs it needs. 
Originally I set it up with links to make a repository out of the 5 CD 
images I have.  Since I'd played with unionfs in my FC attempts I'm 
using that now.  And Apache doesn't like unionfs.

The issue is that Apache normally uses sendfile(2) to transfer static
files.  Using unionfs that results in no data transfered.  The installer
gets no data and errors (on the MD5 sum as it happens).  Apache reports
200, success.  Wireshark shows clearly that the request is answered with
a 200 but no data is sent.  Huh.

After several Google tries I found a mention at the end of a discussion
that lead me to Apache's EnableSendFile option (yeah, since live CDs are
using unionfs now the Knoppix crowd had the answer):

http://www.knoppix.net/forum/viewtopic.php?p=108481
http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile

Although the bug isn't spelled out there at least the workaround is 
apparent.  I'd never have guessed that there was a sendfile system call 
or that Apache uses it or that it doesn't work with unionfs (once you 
know you can find some mention in the unionfs changelogs).  Amazing what 
you learn doing something as (seemingly) simple as setting up a package 
repository.

Dave




More information about the clue-tech mailing list