Jruby daemon gem/plugin

Hi, I am working to convert a ruby application to using JRuby (I want to
use
JMX to monitor a remote process). I am stuck because the original
application uses the daemons gem and plugin. It seams like the daemons
gem
is not compatible with JRuby. When I try to run it I get the exceptions
below:

/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/monitor.rb:64:in
start_with_pidfile': fork is unsafe and disabled by default on JRuby (NotImplementedError) from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/monitor.rb:111:instart’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application_group.rb:113:in
create_monitor' from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:244:instart’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/controller.rb:69:in
run' from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:139:inrun’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in
call' from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:incatch_exceptions’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:138:in
`run’
from ./lib/daemons/queue_runner_ctl:22

and

/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/daemonize.rb:122:in
each_object': ObjectSpace is disabled; each_object will only work with Class, pass +O to enable (RuntimeError) from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/daemonize.rb:122:insimulate’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:130:in
start_load' from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:257:instart’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/controller.rb:72:in
run' from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:139:inrun’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in
call' from /usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:incatch_exceptions’
from
/usr/local/share/jruby-1.1.6/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:138:in
`run’

Is there a jruby compatible verions of the daemons gem? Or should I be
looking for something new to replace this gem?

Thanks,

Josh

Josh M. wrote:

Is there a jruby compatible verions of the daemons gem? Or should I be
looking for something new to replace this gem?

You’ll need to use something else, like backgrounding the process
yourself. I think there may be some daemonizing tools for JVMs out
there, but I don’t have links to them offhand. They might be useful
things to wrap in a gem.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email