diff options
Diffstat (limited to 'projects/mongrel_cluster/lib/mongrel_cluster/init.rb')
-rw-r--r-- | projects/mongrel_cluster/lib/mongrel_cluster/init.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/projects/mongrel_cluster/lib/mongrel_cluster/init.rb b/projects/mongrel_cluster/lib/mongrel_cluster/init.rb index 548ca62..53cb5dc 100644 --- a/projects/mongrel_cluster/lib/mongrel_cluster/init.rb +++ b/projects/mongrel_cluster/lib/mongrel_cluster/init.rb @@ -80,23 +80,23 @@ module Cluster @ports.each do |port| if @clean && pid_file_exists?(port) && !check_process(port) pid_file = port_pid_file(port) - log "missing process: removing #{pid_file}" + Mongrel.log(:info, "missing process: removing #{pid_file}") chdir_cwd do File.unlink(pid_file) end end if pid_file_exists?(port) && check_process(port) - log "already started port #{port}" + Mongrel.log(:info, "already started port #{port}") next end exec_cmd = cmd + " -p #{port} -P #{port_pid_file(port)}" exec_cmd += " -l #{port_log_file(port)}" - log "starting port #{port}" + Mongrel.log(:info, "starting port #{port}") log_verbose exec_cmd output = `#{exec_cmd}` - log(:error, output) unless $?.success? + Mongrel.log(:error, output) unless $?.success? end end @@ -112,20 +112,20 @@ module Cluster @ports.each do |port| pid = check_process(port) if @clean && pid && !pid_file_exists?(port) - log "missing pid_file: killing mongrel_rails port #{port}, pid #{pid}" + Mongrel.log(:info, "missing pid_file: killing mongrel_rails port #{port}, pid #{pid}") Process.kill("KILL", pid.to_i) end if !check_process(port) - log "already stopped port #{port}" + Mongrel.log(:info, "already stopped port #{port}") next end exec_cmd = cmd + " -P #{port_pid_file(port)}" - log "stopping port #{port}" + Mongrel.log(:info, "stopping port #{port}") log_verbose exec_cmd output = `#{exec_cmd}` - log(:error, output) unless $?.success? + Mongrel.log(:error, output) unless $?.success? end end @@ -138,18 +138,18 @@ module Cluster @ports.each do |port| pid = check_process(port) unless pid_file_exists?(port) - log(:error, "missing pid_file: #{port_pid_file(port)}") + Mongrel.log(:error, "missing pid_file: #{port_pid_file(port)}") status = STATUS_ERROR else - log(:info, "found pid_file: #{port_pid_file(port)}") + Mongrel.log(:info, "found pid_file: #{port_pid_file(port)}") end if pid - log(:info, "found mongrel_rails: port #{port}, pid #{pid}") + Mongrel.log(:info, "found mongrel_rails: port #{port}, pid #{pid}") else - log(:error, "missing mongrel_rails: port #{port}") + Mongrel.log(:error, "missing mongrel_rails: port #{port}") status = STATUS_ERROR end - log(:info, "") + Mongrel.log(:info, "") end status @@ -212,7 +212,7 @@ module Cluster end def log_verbose(message) - log(:info, message) if @verbose + Mongrel.log(:info, message) if @verbose end end @@ -329,7 +329,7 @@ module Cluster @options["group"] = @group if @group @options["prefix"] = @prefix if @prefix - log "Writing configuration file to #{@config_file}." + Mongrel.log(:info, "Writing configuration file to #{@config_file}.") File.open(@config_file,"w") {|f| f.write(@options.to_yaml)} end end |