Skip to content
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.

Commit

Permalink
Exit with non-zero return code for error condition
Browse files Browse the repository at this point in the history
  • Loading branch information
hennk authored and adzap committed Jan 7, 2010
1 parent 7097128 commit 3357244
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/action_mailer/ar_sendmail.rb
Expand Up @@ -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
Expand All @@ -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

##
Expand Down Expand Up @@ -417,7 +417,7 @@ def deliver(emails)
def do_exit
log "caught signal, shutting down"
self.class.remove_pid_file
exit
exit 130
end

##
Expand Down

0 comments on commit 3357244

Please sign in to comment.