Permalink
Browse files

Merge branch 'master' of github.com:adzap/ar_mailer

  • Loading branch information...
2 parents ccc9ff0 + fd5e060 commit a3b4ab0a0f278d5d91f360a148eedb38a58ea233 @adzap committed Jan 16, 2010
Showing with 6 additions and 6 deletions.
  1. +3 −3 lib/action_mailer/ar_sendmail.rb
  2. +3 −3 share/linux/ar_sendmail
@@ -282,7 +282,7 @@ def self.run(args = ARGV)
File.open(@@pid_file, 'r') {|f| pid = f.read.chomp }
if system("ps -p #{pid} | grep #{pid}") # returns true if process is running, o.w. false
$stderr.puts "Warning: The pid file #{@@pid_file} exists and ar_sendmail is running. Shutting down."
- exit
+ exit -1
else
# not running, so remove existing pid file and continue
self.remove_pid_file
@@ -302,7 +302,7 @@ def self.run(args = ARGV)
rescue Exception => e
$stderr.puts "Unhandled exception #{e.message}(#{e.class}):"
$stderr.puts "\t#{e.backtrace.join "\n\t"}"
- exit 1
+ exit -2
end
##
@@ -416,7 +416,7 @@ def deliver(emails)
def do_exit
log "caught signal, shutting down"
self.class.remove_pid_file
- exit
+ exit 130
end
##
View
@@ -14,11 +14,11 @@ begin
config = YAML::load(IO.read(config_file)) || {}
if config.empty? || (config.has_key?('defaults') && config.size == 1)
puts "No mailers defined. Exiting."
- exit
+ exit -2
end
rescue Errno::ENOENT
puts "Config file not found at '#{config_file}'!"
- exit
+ exit -3
end
default_options = {'pidfile' => './log/ar_sendmail.pid'}.merge(config.delete('defaults') || {})
@@ -57,7 +57,7 @@ end
def command_error(msg)
puts msg
- exit
+ exit -1
end
if ['start', 'stop', 'restart'].include?(command)

0 comments on commit a3b4ab0

Please sign in to comment.