Code Monkey home page Code Monkey logo

Comments (5)

petrjanda avatar petrjanda commented on September 22, 2024

Hey,

I am not sure if you are still interested in this but today I was busy probably with the same thing.

I bet you mean this error "Getting (libev) kevent: Bad file descriptor on OSX" happening only on your OSX right?
I tracked down the problem to the libev, used by node.js and got to its docs here: http://doc.dvgu.ru/devel/ev.html.

There you can find the function ev_default_fork(). From the description I understand that the event loop need to reinitialized after fork() of new process, so I've added the call right after the new process is created. Did help with the error, but I got different one though. Not sure what it is but perhaps looks like something else got corrupted. This is the output I have:

node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ENOTSOCK, Socket operation on non-socket
at Array. (net.js:1078:7)
at EventEmitter._tickCallback (node.js:108:26)

I am trying to setup new http.Server after the fork btw.

from daemon.node.

petrjanda avatar petrjanda commented on September 22, 2024

This is my current code btw https://github.com/petrjanda/daemon.js/blob/feature%2Fdaemon-cpp/src/daemon.cc

from daemon.node.

indexzero avatar indexzero commented on September 22, 2024

@petjanda Interesting! I'll have to play around with this sometime soon.

from daemon.node.

petrjanda avatar petrjanda commented on September 22, 2024

Then please ping me once you will make some progress in that, I will do the same.
This will probably require a more deep look into node.js internals to find out what is happening inside the event loop :/

from daemon.node.

mineshaftgap avatar mineshaftgap commented on September 22, 2024

Is there any movement on this bug? I am running daemon.node 0.5.1, node 0.8.14, Mac OSX 10.8.2 and this still seems to be happening. Is any plan to make this work on Max OSX?

Thanks and here is the test code:

var daemon = require('daemon'),
    pid    = daemon.start('test-stdout.log', 'test-stderr.log');

daemon.lock('/tmp/test.pid');

require('http').createServer(function (request, response) {
    response.end(request.url);
}).listen(1234, '0.0.0.0');

from daemon.node.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.