Comments (3)
The long and the short of it is that Resque does not disconnect from STDOUT and STDERR when BACKGROUND=yes rake resque:work
is called, so it isn't by definition a well-behaved daemon; this cannot be changed/fixed on the Resque side without a major version bump, and that's not something I'm willing to take on without significant discussion with the other contributors & maintainers, especially considering the following.
The maintainer of Cap3 & SSHKit @leehambley rightfully has reservations about explicitly supporting badly-behaved processes, and raises valid points about using this approach in the first place:
I spent the last few years trying to find a knowledge war about badly behaved programs,
and I'm not keen to do the same again. I also rarely see the use-case for starting daemons
via Cap. (Surely, you'd want them monitored, and started by the system, and you would
instruct the system to start them, using monit, god, bluepill, initd, runit, daemontools, initd, etc?)
An immediate solution is would be to avoid Resque's BACKGROUND=yes
, and instead to invoke the rake task using Cap3's background
; you will lose the startup noise, which would cause launch-failure issues to be harder to debug.
Ultimately, the right solution is to follow the advice above and use a system-level utility to ensure that the task is running; failing to do so is an operations nightmare waiting to happen.
from capistrano-resque.
Ultimately, the right solution is to follow the advice above and use a system-level utility to ensure that the task is running; failing to do so is an operations nightmare waiting to happen.
Absolutely, and on all modern Linuxes this is well documented, and easy. My personal preference being upstart
on systems where it is supported natively, and runit
(C) or supervisord
(Python) on systems where there is only systemv initd
from capistrano-resque.
#82 fixes this by redirecting stderr/stdout to /dev/null (or to whatever you configure in the :resque_log_file
setting).
However, as discussed above, Capistrano isn't a great way to directly handle daemonized processes (I wound up personally switching to upstart for resque and no longer use capistrano-resque in to deploy in production).
I'll probably add some info to the README recommending something like upstart/systemd/initd/etc. instead of using this gem.
from capistrano-resque.
Related Issues (20)
- incompatibility between capistrano-resque and capistrano-rbenv HOT 13
- Having issues deploying
- Sometimes resque:scheduler:restart doesnt kill active process, instead it spawns new one HOT 1
- Not Working correctly with Resque 1.26 HOT 6
- failed to create symbolic link HOT 1
- Bump version for resque_extra_env HOT 3
- Unable to start resque, there is no log file created.
- Example usage with capistrano v3.1? HOT 10
- Verify that the ./tmp/pids folder exists HOT 2
- Cap 3 version requires sudo to resque:stop (or restart) HOT 2
- resque:start hangs HOT 8
- INFO -- : Failed to start worker : #<Errno::EIO: Input/output error - <STDERR>> HOT 4
- Expand README HOT 1
- resque:* produces no output HOT 16
- Multiple Log Files for Resque HOT 1
- Lost workers HOT 4
- Gem requires rake task HOT 4
- cap production resque:restart failing, with nothing written to stdout HOT 9
- VERBOSE=1 should be an option HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano-resque.