prob with daemon

Discussion in 'Ruby' started by Junkone, Mar 2, 2008.

  1. Junkone

    Junkone Guest

    i am struggling with this daemon gem and cannot get it to work. any
    help is appreciated.

    E:\TradingTools\Development\app\helpers>ruby myserver_control.rb start
    e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/daemonize.rb:
    103:in `fork': the fork() function is unimplemente
    d on this machine (NotImplementedError)
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    daemonize.rb:103:in `safefork'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    daemonize.rb:203:in `daemonize'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    application.rb:115:in `start_load'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    application.rb:236:in `start'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    controller.rb:69:in `run'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
    daemons.rb:136:in `run'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    cmdline.rb:105:in `call'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    cmdline.rb:105:in `catch_exceptions'
    from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
    daemons.rb:135:in `run'
    from myserver_control.rb:6

    # this is myserver_control.rb

    require 'rubygems' # if you use RubyGems
    require 'daemons'

    Daemons.run('myserver.rb')

    # this is myserver.rb
    # it does nothing really useful at the moment

    loop do
    sleep(5)
    end
     
    Junkone, Mar 2, 2008
    #1
    1. Advertising

  2. Junkone

    Jano Svitok Guest

    On Sun, Mar 2, 2008 at 5:39 PM, Junkone <> wrote:
    > i am struggling with this daemon gem and cannot get it to work. any
    > help is appreciated.
    >
    > E:\TradingTools\Development\app\helpers>ruby myserver_control.rb start
    > e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/daemonize.rb:
    > 103:in `fork': the fork() function is unimplemente
    > d on this machine (NotImplementedError)
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    > daemonize.rb:103:in `safefork'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    > daemonize.rb:203:in `daemonize'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    > application.rb:115:in `start_load'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    > application.rb:236:in `start'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    > controller.rb:69:in `run'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
    > daemons.rb:136:in `run'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    > cmdline.rb:105:in `call'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    > cmdline.rb:105:in `catch_exceptions'
    > from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
    > daemons.rb:135:in `run'
    > from myserver_control.rb:6
    >
    > # this is myserver_control.rb
    >
    > require 'rubygems' # if you use RubyGems
    > require 'daemons'
    >
    > Daemons.run('myserver.rb')
    >
    > # this is myserver.rb
    > # it does nothing really useful at the moment
    >
    > loop do
    > sleep(5)
    > end


    I see you are on windows - as the error message says, the fork is not
    implemented there.
    These are you options (maybe more):
    1. use fork from the win32-process gem. see
    http://rubyforge.org/docman/view.php/85/707/README.html for caveats
    2. remove the fork call from the daemons lib code
    3. reuse code from mongrel_service and/or win32-service gems
     
    Jano Svitok, Mar 2, 2008
    #2
    1. Advertising

  3. On 02.03.2008 20:56, Jano Svitok wrote:
    > On Sun, Mar 2, 2008 at 5:39 PM, Junkone <> wrote:
    >> i am struggling with this daemon gem and cannot get it to work. any
    >> help is appreciated.
    >>
    >> E:\TradingTools\Development\app\helpers>ruby myserver_control.rb start
    >> e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/daemonize.rb:
    >> 103:in `fork': the fork() function is unimplemente
    >> d on this machine (NotImplementedError)
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    >> daemonize.rb:103:in `safefork'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    >> daemonize.rb:203:in `daemonize'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    >> application.rb:115:in `start_load'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    >> application.rb:236:in `start'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    >> controller.rb:69:in `run'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
    >> daemons.rb:136:in `run'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    >> cmdline.rb:105:in `call'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
    >> cmdline.rb:105:in `catch_exceptions'
    >> from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
    >> daemons.rb:135:in `run'
    >> from myserver_control.rb:6
    >>
    >> # this is myserver_control.rb
    >>
    >> require 'rubygems' # if you use RubyGems
    >> require 'daemons'
    >>
    >> Daemons.run('myserver.rb')
    >>
    >> # this is myserver.rb
    >> # it does nothing really useful at the moment
    >>
    >> loop do
    >> sleep(5)
    >> end

    >
    > I see you are on windows - as the error message says, the fork is not
    > implemented there.
    > These are you options (maybe more):
    > 1. use fork from the win32-process gem. see
    > http://rubyforge.org/docman/view.php/85/707/README.html for caveats
    > 2. remove the fork call from the daemons lib code
    > 3. reuse code from mongrel_service and/or win32-service gems


    4. use cygwin's Ruby.

    robert
     
    Robert Klemme, Mar 2, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. drishtik

    dataset update prob

    drishtik, Sep 9, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    637
  2. paraag

    vhdl 2 blif prob

    paraag, Feb 18, 2004, in forum: VHDL
    Replies:
    0
    Views:
    1,205
    paraag
    Feb 18, 2004
  3. Jean-Paul Calderone
    Replies:
    0
    Views:
    480
    Jean-Paul Calderone
    Mar 20, 2009
  4. Floris Bruynooghe
    Replies:
    1
    Views:
    473
    Floris Bruynooghe
    Mar 24, 2009
  5. Daemon Win32::Daemon;

    , Sep 7, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    275
Loading...

Share This Page