Ruote on Rails : worker not starting when rails server daemonized

60 views
Skip to first unread message

Christophe Malaurie

unread,
Jun 20, 2012, 5:50:19 AM6/20/12
to openwfe...@googlegroups.com
Hi all
Using ruote+ruotekit template, and no process starts when running:
> rails s -d (which is letting Rails Webrick server running as as daemon)

So in that mode none worker is running. Is there something I do not get about ruby threads ? Even in development environment it is a bit of a pain to get a terminal running permanently in order to have the workflow processed.

I'm using ruote 2.2.0 on Debian.
Everything fine when running
> rails s (but you have to let a terminal opened)...
I saw the rake task:run_worker comment but again you cannot daemonize..

Tx and Cheers
Christophe

John Mettraux

unread,
Jun 20, 2012, 6:01:15 AM6/20/12
to openwfe...@googlegroups.com
Hello Christophe,

there are lots of daemonization toolkits available. For example:

https://github.com/kennethkalmer/daemon-kit

There is also Process.daemon() available in Ruby 1.9.x

There are also tools like foreman that help you manage your daemons/servers:

https://github.com/kennethkalmer/daemon-kit

Please tell me if this doesn't answer your question.


Kind regards,

--
John Mettraux - http://lambda.io/jmettraux

Christophe Malaurie

unread,
Jun 20, 2012, 12:36:01 PM6/20/12
to openwfe...@googlegroups.com
Tx John
was expecting a Rails "application" to run in a way but indeed it is just an http server running as wa daemon.
So
namespace :ruote do
  desc "Run a worker thread for ruote"
  task :run_worker => :environment do
       Process.daemon
       RuoteKit.run_worker(RUOTE_STORAGE)
  end
end
works well apparently, could had some signal traps but not sure how the Worker would react in any case as it does not seems to handle signals.
Did not specify to stay in the current directory, but no worries apparently.
Could have run the rake task with "nohup &" too, hard way I find.
Cheers
Christophe


--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to openwfe...@googlegroups.com
to unsubscribe : send email to openwferu-use...@googlegroups.com
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply all
Reply to author
Forward
0 new messages