Giter VIP home page Giter VIP logo

Comments (2)

sodabrew avatar sodabrew commented on June 27, 2024

Are you using Ruby 2.0 or higher? If so, what may be happening is the code is opening a connection to Pg first, then calling daemonize, then trying to use the connection. In Ruby 2.0+, sockets are close-on-exec by default, which means the connection to Pg is getting closed during the fork.

The simplest solution is to open connections after daemonizing, but you may have to rework some error-reporting code because you probably expect the process to exit 1 on the command line if it cannot talk to Pg.

This doesn't happen with sqlite because it will (re)open a local file handle when it needs to (I think - this would match the symptoms).

from daemons.

snitko avatar snitko commented on June 27, 2024

You are right. I suspected that, but couldn't quite put my finger on it. Thank you.

from daemons.

Related Issues (20)

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.