indexzero/daemon.node — Issue #9: In server daemon, fs.asyncFun only works after killing 1st request
Author: jiem
Created: 2011-11-21 15:10:18+00:00
State: open

var daemon = require('daemon');
var fs = require('fs');
var http = require('http');

http.createServer(function(req, res) {
fs.readFile('yourFile', 'utf8', function(err, data) {
res.end(data);
});
}).listen(8080);

daemon.daemonize('app.log', 'app.pid', console.log);

The above server freezes at the 1st http request, fs.readFile never triggers the callback.
It's only after killing the 1st request in the browser that everything works.