Permalink
Browse files

Add a notes regarding ruby >= 1.9 requirement for BACKGROUND

  • Loading branch information...
1 parent 39d51cb commit dcfbe365c256bb5705739739b569f62fa7ae52a0 @cleishm cleishm committed Aug 24, 2011
Showing with 7 additions and 3 deletions.
  1. +4 −3 README.markdown
  2. +3 −0 lib/resque/tasks.rb
View
@@ -267,9 +267,10 @@ worker process. Use the PIDFILE option for easy access to the PID:
### Running in the background
-There are scenarios where it's helpful for the resque worker to run
-itself in the background (usually in combination with PIDFILE). Use the
-BACKGROUND option so that rake will return as soon as the worker is started.
+(Only supported with ruby >= 1.9). There are scenarios where it's helpful for
+the resque worker to run itself in the background (usually in combination with
+PIDFILE). Use the BACKGROUND option so that rake will return as soon as the
+worker is started.
$ PIDFILE=./resque.pid BACKGROUND=yes QUEUE=file_serve \
rake environment resque:work
View
@@ -19,6 +19,9 @@
end
if ENV['BACKGROUND']
+ unless Process.respond_to?('daemon')
+ abort "env var BACKGROUND is set, which requires ruby >= 1.9"
+ end
Process.daemon(true)
end

0 comments on commit dcfbe36

Please sign in to comment.