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.
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.
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.