Forum: Ruby Daemons lib not dong much?...

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
sa 1. (Guest)
on 2008-12-18 16:12
Hello - I'm trying to run a background daemon that will monitor changes
in a mysql database. The file to monitor the changes works fine when run
by itself from the prompt as
$ ruby changes.rb

However, when I try to use it in a daemon file, not much happens. Here's
the file (changes_daemon.rb):

require 'daemons'
# all the other required come here

def main

if __FILE__ == $0

When I run this at the prompt:
$ruby changes_daemon.rb start
$ (next shell line after hitting return - no errors)

Nothing happens (it's supposed to write to a table and a log file, so I
can see if anything occurs).

Any insights will be great - thanks!
This topic is locked and can not be replied to.