From: ara.t.howard@... Date: 2006-07-14T05:01:03+09:00 Subject: Re: Nuby Q: Daemonize (other materials have been read!) On Fri, 14 Jul 2006, Rogue Amateur wrote: > I'd love to post the code, but I can't - it's proprietary. If I can > rewrite it so that I cna post it, I will do so tonight. Basically, I'll > have to rewrite it, and verify that the rewrite has the same problem. > > truely odd things are happening: > daemon.rb my_code.rb > with your Exception recue clause returned > nothing. Executes Listener stop. > ruby daemon.rb my_code.rb > with the exception clause returns > nothing. However, it doesn't execute the Listener stop either. > (using daemonize inside the code) > my_code.rb > with exception clause returns 2 files (1503 and 1502, > both of which say: > exit (SystemExit) > /usr/lib/site_ruby/1.8/daemonize.rb:26:in `exit' > /usr/lib/site_ruby/1.8/daemonize.rb:26:in `daemonize' > ./my_code.rb:621 > **** repeat the run, and new files are not created. > > I'm not seeing any errors logged to syslog, or my verbose log. > > ONCE, I seemed to get it to work. I ran it as a plain run in a redirect > to /dev/null, and then killed the window. It killed that process, but > didn't kill the listener. Then, I ran it with "ruby daemon.rb > my_code.rb" (no daemonize inside the code)., and it worked, and ran > through to completion. I have not been able to do that again! > > will work on rewriting tonight, and posting. apologies for the > stupidity. > > RA can all of your code run as in ./my_code.rb ?? eg. not ruby ./my_code.rb if not that may be your problem. when you do daemon.rb ./my_code.rb it's literally going to do system './my_code.rb' at some point. if your code requires system 'ruby ./my_code.rb' the you'd need to do daemon.rb ruby ./my_code.rb regards. -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama