From 90856da2e8f500c168a53257a6bc8cbfa536af93 Mon Sep 17 00:00:00 2001 From: Coleman Date: Sun, 23 Nov 2008 13:56:17 -0600 Subject: [PATCH] use ruby daemons instead of rack to control facebook application --- facebook.ru | 10 ---------- facebook_daemon.rb | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 10 deletions(-) delete mode 100644 facebook.ru create mode 100755 facebook_daemon.rb diff --git a/facebook.ru b/facebook.ru deleted file mode 100644 index 160f4f2..0000000 --- a/facebook.ru +++ /dev/null @@ -1,10 +0,0 @@ -require 'rubygems' -require 'sinatra' - -Sinatra::Application.default_options.merge!( - :run => false, - :env => :production -) - -require 'binaryattraction_facebooker' -run Sinatra.application diff --git a/facebook_daemon.rb b/facebook_daemon.rb new file mode 100755 index 0000000..23dcb69 --- /dev/null +++ b/facebook_daemon.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'daemons' + +opts = { + :app_name => 'binaryattraction_facebooker', + :dir_mode => :script, + :dir => '/log', + :backtrace => true, + :multiple => true, + :log_output => true +} + +Daemons.run(File.dirname(__FILE__) + '/binaryattraction_facebooker.rb', opts)