Victor Thompson
2008-Sep-16 16:56 UTC
Creating a Daemon (win32-service) and Accessing ActionMailer
I''m trying to create a win32-service (ruby script with Rails environment) utilizing the Daemon class and it currently prematurely exits when it encounters a method of mine that calls a delivery via ActionMailer. Here is the process: Windows Service (Ruby script Daemon class) | v MyModel.save (from within the Ruby script via requiring the Rails environment) | v after_create :deliver_notification This causes my Daemon to exit. Has anyone tried anything similar? I''ve tried breaking the MyModel.save off onto another thread with no luck. I don''t know if the problem is the time required to deliver the message or if it''s because ActionMailer uses its own Daemon. Anyone have any thoughts? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Victor Thompson
2008-Sep-16 18:42 UTC
Re: Creating a Daemon (win32-service) and Accessing ActionMailer
Just an update, the exception I am capturing is a "Bad file descriptor" exception. The actionmailer model and method work well outside the windows service. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pardee, Roy
2008-Sep-16 20:07 UTC
Re: Creating a Daemon (win32-service) and Accessing ActionMailer
Permissions problem maybe? I have a vague association in my mind between that error and server not being accessible... What credentials does your service run under? Is it an account w/network permissions? -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Victor Thompson Sent: Tuesday, September 16, 2008 11:42 AM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Re: Creating a Daemon (win32-service) and Accessing ActionMailer Just an update, the exception I am capturing is a "Bad file descriptor" exception. The actionmailer model and method work well outside the windows service. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Victor Thompson
2008-Sep-16 21:14 UTC
Re: Creating a Daemon (win32-service) and Accessing ActionMailer
Roy Pardee wrote:> Permissions problem maybe? I have a vague association in my mind > between that error and server not being accessible... > > What credentials does your service run under? Is it an account > w/network permissions?Thanks for replying! I seem to have full permissions from the command line and everything else works from the service except the mailer. I don''t forward any credentials to the mailer concerning my actual login either. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pardee, Roy
2008-Sep-16 21:20 UTC
Re: Creating a Daemon (win32-service) and Accessing ActionMailer
From the command line in an interactive session? That''s != the environment you get when you''re running from a service... If you haven''t already, just for a goof, temporarily have the service run under your domain credentials & see if it makes a difference. -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Victor Thompson Sent: Tuesday, September 16, 2008 2:14 PM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Re: Creating a Daemon (win32-service) and Accessing ActionMailer Roy Pardee wrote:> Permissions problem maybe? I have a vague association in my mind > between that error and server not being accessible... > > What credentials does your service run under? Is it an account > w/network permissions?Thanks for replying! I seem to have full permissions from the command line and everything else works from the service except the mailer. I don''t forward any credentials to the mailer concerning my actual login either. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Victor Thompson
2008-Sep-16 21:46 UTC
Re: Creating a Daemon (win32-service) and Accessing ActionMailer
Roy Pardee wrote:> From the command line in an interactive session? That''s != the > environment you get when you''re running from a service... > > If you haven''t already, just for a goof, temporarily have the service > run under your domain credentials & see if it makes a difference.Sadly that didn''t make a difference. I even tried to log out and back in again, which still caused the same exception to be logged. Can a daemon such as ActionMailer''s delivery methods be called from within another daemon (win32-service)? Vic. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Victor Thompson
2008-Sep-17 19:34 UTC
Re: Creating a Daemon (win32-service) and Accessing ActionMailer
I have what seems to be a solution. The problem was unrelated to ActionMailer. In reality the problem was occurring because of a few constants that were declared in multiple places. When MyModel re-declared these constants this error (Bad File Descriptor) would be being thrown. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---