Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3943490
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:47:17+00:00 2026-05-20T00:47:17+00:00

I’ve asked a different question about directory watching, which was answered, but the other

  • 0

I’ve asked a different question about directory watching, which was answered, but the other half of the question is how to best create a never ending process, in ruby, to do this.
Here are the requirements:

  • run forever
  • be monitorable (i.e. know if it is up or down)
  • have some sort of way of restarting it and ensuring it is up (God?)
  • start / stop using Capistrano (would be nice!)

We’ve looked at BackgroundRb, but that seems a bit outdated and to be honest unreliable!
We’ve looked at DelayedJob, but that seems geared for one off jobs (because a never-ending job seems to block any other job from getting done as jobs are done sequentially).

We are running a bunch of Ubuntu servers that form our environment.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:47:18+00:00Added an answer on May 20, 2026 at 12:47 am

    I have an event machine loop tailing some nginx log files and putting them into MongoDB. The “log eater” scripts are running with ruby daemons. http://daemons.rubyforge.org/

    I have found it to be much more reliable than god. This also monitors and restarts your script if it dies. If you want notification if the runner dies, you can use monit to do that.

    Here is my runner script for daemons:

    #!/usr/bin/env ruby
    require 'rubygems'
    require 'bundler' 
    Bundler.require(:default)
    Bundler.setup(:default)
    
    options = {
      :app_name   => "log_eater",
      :dir_mode   => :system,
      :multiple   => true,
      :backtrace  => true,
      :monitor    => true
    }
    
    Daemons.run(File.join(File.dirname(__FILE__), 'log_eater.rb'), options)
    

    This has been running for many months with no leak or no problem. God had problems with leaks and dying. Capistrano can restart this by restarting your startup script.

    Here is an excerpt from mine for gentoo linux

    start() {
    ebegin "Starting log-eater"
        cd /ruby/STABLE/quickanalytics
       `scripts/log_eater_runner.rb start -- /usr/logs/nginx.log`
    eend $? "Failed to start log-eater" 
    }
    

    — after the start command is for any args you want passed to your script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I don't have much knowledge about the IPv6 protocol, so sorry if the question
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.