1
#!/usr/bin/env ruby
2
# encoding: utf-8
3
4
if RUBY_VERSION < '1.9'
5
  $KCODE = 'u'
6
else
7
  Encoding.default_internal = Encoding::UTF_8
8
  Encoding.default_external = Encoding::UTF_8
9
end
10
11
require 'rubygems' if RUBY_VERSION < '1.9'
12
require 'daemons'
13
14
APP_ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
15
script_file = File.join(File.expand_path(APP_ROOT),'vendor','plugins','activemessaging','poller.rb')
16
tmp_dir = File.join(File.expand_path(APP_ROOT), 'tmp/pids')
17
18
options = {
19
  :app_name   => "poller",
20
  :dir_mode   => :normal,
21
  :dir        => tmp_dir,
22
  :multiple   => true,
23
  :ontop      => false,
24
  :mode       => :load,
25
  :backtrace  => true,
26
  :monitor    => false,
27
  :log_output => true
28
}
29
30
Daemons.run(script_file,options)