Forum: JRuby jruby daemon gem/plugin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bf512c651c47ac6421e41f93dc19c726?d=identicon&s=25 Josh Moore (Guest)
on 2009-02-10 10:23
(Received via mailing list)
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:in
`start'
    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:in
`start'
    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:in
`run'
    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:in
`catch_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:in
`simulate'
    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:in
`start'
    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:in
`run'
    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:in
`catch_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
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-02-10 23:40
(Received via mailing list)
Josh Moore 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
This topic is locked and can not be replied to.