On Mon, Jan 4, 2010 at 10:22 AM, Marius Mårnes Mathiesen
<[email protected]> wrote:
> On Wed, Dec 30, 2009 at 5:03 PM, Benjamin Podszun
> <[email protected]> wrote:
>>
>> Now - it obviously works now, but I'm sure I did something very nasty
>> here. What would be the _right_ way to configure the smtp settings for
>> the poller script/the message_forwarding_processor.rb?

Hi Marius.

> Ben,
> For being "ignorant about Ruby" I must say you did some good work :-)

Just "messing around". More dangerous than useful :)

> Actually, the config/boot file should be loaded through quite a few steps by
> the script/poller file (this loads another file which loads another file
> which ... you get the idea.) Before changing this: what happened? Did you
> get any errors? And do you supply a RAILS_ENV when running the poller
> script?

Before changing this setting I got an error from the sendmail
configuration: It basically just tried to send it out using my local
sendmail. This doesn't work (for now), for several reasons, one is
that I don't have a FQDN for that internal machine and the mail will
be rejected by any target MTA.
Yes, I can (and should!) fix that with a working smarthost
configuration or something, but so far I didn't bother.

The environments/production.rb configuration (see original mail) works
for now, but obviously wasn't used by the poller script: It didn't
connect directly and use the settings there dropped the notification
in my sendmail outbox and it bounced.

For reference: This is my /etc/init.d/git-poller init script:
/bin/su - git -c "cd /var/www/git.devtools/gitorious;
RAILS_ENV=production script/poller $@"

Just to be safe: This is my complete poller script:

#!/usr/bin/env ruby
# encoding: utf-8

if RUBY_VERSION < '1.9'
  $KCODE = 'u'
else
  Encoding.default_internal = Encoding::UTF_8
  Encoding.default_external = Encoding::UTF_8
end

require File.dirname(__FILE__) + '/../config/boot'
require 'rubygems' if RUBY_VERSION < '1.9'
require 'daemons'

APP_ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
script_file = 
File.join(File.expand_path(APP_ROOT),'vendor','plugins','activemessaging','poller.rb')
tmp_dir = File.join(File.expand_path(APP_ROOT), 'tmp/pids')

options = {
  :app_name   => "poller",
  :dir_mode   => :normal,
  :dir        => tmp_dir,
  :multiple   => true,
  :ontop      => false,
  :mode       => :load,
  :backtrace  => true,
  :monitor    => false,
  :log_output => true
}

Daemons.run(script_file,options)


Again, I'm still ignorant, but ruby gems is afaik the "CPAN of ruby",
right? Is this connected to rails? That's the only "require" that was
in the file, other than "daemons". Which script should include the
environment configuration or the rails stuff? If you give me a hint, a
starting point, I might be able to track this further down. For now
I'm clueless.

Thanks for the help so far. Much appreciated!

Regards,
Ben

--

You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/gitorious?hl=en.


Reply via email to