Daemons lib not dong much?...

S

sa 125

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
Daemons.run(path_to_file)
end

if __FILE__ == $0
main
end


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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top