From 3357244db35a22c15da761079cbb30cea2f4240f Mon Sep 17 00:00:00 2001 From: Henning Kiel Date: Mon, 26 Oct 2009 18:36:00 +0800 Subject: [PATCH] Exit with non-zero return code for error condition --- lib/action_mailer/ar_sendmail.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/action_mailer/ar_sendmail.rb b/lib/action_mailer/ar_sendmail.rb index b2fbcac..27e61b0 100644 --- a/lib/action_mailer/ar_sendmail.rb +++ b/lib/action_mailer/ar_sendmail.rb @@ -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 ## @@ -417,7 +417,7 @@ def deliver(emails) def do_exit log "caught signal, shutting down" self.class.remove_pid_file - exit + exit 130 end ##