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

Commit

Permalink
Use non-zero exit codes for init.d script when error found
Browse files Browse the repository at this point in the history
  • Loading branch information
hennk authored and adzap committed Jan 7, 2010
1 parent 3357244 commit fd5e060
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions share/linux/ar_sendmail
Original file line number Diff line number Diff line change
Expand Up @@ -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') || {})
Expand Down Expand Up @@ -57,7 +57,7 @@ end

def command_error(msg)
puts msg
exit
exit -1
end

if ['start', 'stop', 'restart'].include?(command)
Expand Down

0 comments on commit fd5e060

Please sign in to comment.