how can run rake resque:scheduler in daemon mode
Asked Answered
C

4

7

I am using resque:scheduler gem in my rails 3 application.

How can start rake resque:scheduler in daemon mode.

and if you know then please let me know,

How can I configure this task in GOD script?

Corduroys answered 23/2, 2013 at 18:5 Comment(0)
C
1
PIDFILE=./resque-scheduler.pid BACKGROUND=yes rake resque:scheduler

complete doc of resque scheduler available here

Corduroys answered 2/3, 2013 at 5:53 Comment(0)
C
6

I guess you only have to do this

BACKGROUND=yes rake resque:scheduler 

and perhaps that would work check over here

Hope this help

Chafer answered 1/3, 2013 at 12:7 Comment(4)
thanks Viren have used the way PIDFILE=./resque-scheduler.pid BACKGROUND=yes rake resque:scheduler it worked for meCorduroys
Note, you should have a resque version >= 1.20 to use BACKGROUND=yes optionRespectable
It runs for some time and stops. How can you keep running all the time?Valerievalerio
@Valerievalerio create a new SO question and provide a context around it.Chafer
C
1
PIDFILE=./resque-scheduler.pid BACKGROUND=yes rake resque:scheduler

complete doc of resque scheduler available here

Corduroys answered 2/3, 2013 at 5:53 Comment(0)
I
0

try this out

rake resque:scheduler BACKGROUND=true

or

rake resque:scheduler &

and now if you want to suppress the output of the rake task try running it with nohup

nohup rake my:task BACKGROUND=true
Issuant answered 29/1, 2014 at 12:34 Comment(0)
V
0

Try the following to configure resque-schedular in God script.

Install god gem

gem install god

create a file with name as watch.god in your project folder.

Add following to watch.god

God.watch do |w|
  w.name = "resque_schedular"
  w.dir = '/home/machine_name/project_path'
  w.start = "BACKGROUND=yes bundle exec rake environment resque:scheduler"
  w.keepalive
end

Run god in terminal to test

$ god -c path/to/watch.god -D

Run god in daemon(background) from terminal

$ god -c path/to/watch.god
Valerievalerio answered 5/6, 2017 at 6:57 Comment(1)
Watch out for the typo in God configuration, it's BACKGROUND not BACKGROUNGDyson

© 2022 - 2024 — McMap. All rights reserved.