0
@@ -23,11 +23,11 @@ module Merb
0
@port.to_i.upto(@port.to_i + @cluster.to_i-1) do |port|
0
pidfile = pid_file(port)
0
- pid = IO.read(pidfile).chomp.to_i
0
+ pid = IO.read(pidfile).chomp.to_i
if File.exist?(pidfile)0
- puts "Starting merb server on port #{port}, pid file: #{pidfile} and process id is #{pid}"
0
+ puts "Starting merb server on port #{port}, pid file: #{pidfile} and process id is #{pid}"
if Merb::Config[:verbose]0
raise "Merb is already running: port is #{port}, pid file: #{pidfile}, process id is #{pid}"
0
@@ -35,12 +35,11 @@ module Merb
0
elsif Merb::Config[:daemonize]
0
pidfile = pid_file(port)
0
- pid = IO.read(pidfile).chomp.to_i
0
+ pid = IO.read(pidfile).chomp.to_i
if File.exist?(pidfile)0
- puts "Removing pid file #{pidfile}, port is #{port}..."
0
+ puts "Daemonizing..."
if Merb::Config[:verbose]0
raise "Merb is already running: port is #{port}, pid file: #{pidfile}, process id is #{pid}"
0
@@ -48,9 +47,9 @@ module Merb
0
trap('INT') { puts "\nExiting"; exit }
0
- puts "Running bootloaders..."
0
+ puts "Running bootloaders..."
if Merb::Config[:verbose]0
- puts "Starting Rack adapter..."
0
+ puts "Starting Rack adapter..."
if Merb::Config[:verbose]0
Merb.adapter.start(Merb::Config.to_hash)
0
@@ -62,11 +61,11 @@ module Merb
0
# True if Merb is running on the specified port.
0
- puts "About to check if port #{port} is alive..."
0
+ puts "About to check if port #{port} is alive..."
if Merb::Config[:verbose]0
pidfile = pid_file(port)
0
- puts "Pidfile is #{pidfile}..."
0
+ puts "Pidfile is #{pidfile}..."
if Merb::Config[:verbose]0
pid = IO.read(pidfile).chomp.to_i
0
- puts "Process id is #{pid}"
0
+ puts "Process id is #{pid}"
if Merb::Config[:verbose]0
@@ -111,7 +110,7 @@ module Merb
0
# port<~to_s>:: The port of the Merb process to daemonize.
0
- puts "About to fork..."
0
+ puts "About to fork..."
if Merb::Config[:verbose]0
@@ -131,10 +130,10 @@ module Merb
0
if Merb::Config[:group]
0
- puts "About to change privilege to group #{Merb::Config[:group]} and user #{Merb::Config[:user]}"
0
+ puts "About to change privilege to group #{Merb::Config[:group]} and user #{Merb::Config[:user]}"
if Merb::Config[:verbose]0
_change_privilege(Merb::Config[:user], Merb::Config[:group])
0
- puts "About to change privilege to user #{Merb::Config[:user]}"
0
+ puts "About to change privilege to user #{Merb::Config[:user]}"
if Merb::Config[:verbose]0
_change_privilege(Merb::Config[:user])
0
@@ -153,7 +152,7 @@ module Merb
0
# instead of the port based PID file.
0
def remove_pid_file(port)
0
pidfile = pid_file(port)
0
- puts "Removing pid file #{pidfile} (port is #{port})
"
0
+ puts "Removing pid file #{pidfile} (port is #{port})
..."
0
FileUtils.rm(pidfile) if File.exist?(pidfile)
0
@@ -170,8 +169,9 @@ module Merb
0
# instead of the port based PID file.
0
pidfile = pid_file(port)
0
- puts "
pid file stored at #{pidfile}"
0
+ puts "
Storing pid file to #{pidfile}..."
0
FileUtils.mkdir_p(File.dirname(pidfile)) unless File.directory?(File.dirname(pidfile))
0
+ puts "Created directory, writing process id..." if Merb::Config[:verbose]
0
File.open(pidfile, 'w'){ |f| f.write("#{Process.pid}") }