# Daemons lib not dong much?

**URL:** <https://www.ruby-forum.com/t/daemons-lib-not-dong-much/155958>\
**Category:** Ruby\
**Created:** [December 18, 2008, 3:12pm UTC](https://www.ruby-forum.com/t/daemons-lib-not-dong-much/155958 "2008-12-18T15:12:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sa125](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@sa125](https://www.ruby-forum.com/u/sa125)\
**Post date:** [December 18, 2008, 3:12pm UTC](https://www.ruby-forum.com/t/daemons-lib-not-dong-much/155958/1 "2008-12-18T15:12:40Z")

</div>

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!
