Skip to content

Commit dcfbe36

Browse files
committed
Add a notes regarding ruby >= 1.9 requirement for BACKGROUND
1 parent 39d51cb commit dcfbe36

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.markdown

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,10 @@ worker process. Use the PIDFILE option for easy access to the PID:
267267

268268
### Running in the background
269269

270-
There are scenarios where it's helpful for the resque worker to run
271-
itself in the background (usually in combination with PIDFILE). Use the
272-
BACKGROUND option so that rake will return as soon as the worker is started.
270+
(Only supported with ruby >= 1.9). There are scenarios where it's helpful for
271+
the resque worker to run itself in the background (usually in combination with
272+
PIDFILE). Use the BACKGROUND option so that rake will return as soon as the
273+
worker is started.
273274

274275
$ PIDFILE=./resque.pid BACKGROUND=yes QUEUE=file_serve \
275276
rake environment resque:work

lib/resque/tasks.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
end
2020

2121
if ENV['BACKGROUND']
22+
unless Process.respond_to?('daemon')
23+
abort "env var BACKGROUND is set, which requires ruby >= 1.9"
24+
end
2225
Process.daemon(true)
2326
end
2427

0 commit comments

Comments
 (0)