Created
June 30, 2010 14:57
-
-
Save seamusabshere/458758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'daemon_spawn' # currently seamusabshere-daemon-spawn | |
# BASEDIR = '/var/www/html/offset1' | |
BASEDIR = '/home/vagrant/offset1' | |
PID_PATH = "#{BASEDIR}/daemons/offset1_imap_checker.pid" | |
LOG_PATH = "#{BASEDIR}/log/offset1_imap_checker.log" | |
TIMEOUT = 60 | |
# SIGNAL = 'INT' | |
class ImapCheckerWorker < DaemonSpawn::Base | |
def start(args) | |
Dir.chdir BASEDIR | |
require File.expand_path('../../config/application', __FILE__) | |
Offset1::Application.initialize! | |
ImapChecker.instance.start | |
# | |
# Kernel.exec "rails runner -e production ''" | |
end | |
def stop | |
end | |
end | |
ImapCheckerWorker.spawn!(:log_file => LOG_PATH, | |
:pid_file => PID_PATH, | |
:sync_log => true, | |
:working_dir => BASEDIR, | |
:singleton => true, | |
:timeout => TIMEOUT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment