Permalink
Browse files

Use non-zero exit codes for init.d script when error found

  • Loading branch information...
1 parent 3357244 commit fd5e060fb3ef2580ee0d09468413c7fec689e970 @hennk hennk committed with adzap Oct 26, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 share/linux/ar_sendmail
View
6 share/linux/ar_sendmail
@@ -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 fd5e060

Please sign in to comment.