diff options
Diffstat (limited to 'lib/mongrel/configurator.rb')
-rw-r--r-- | lib/mongrel/configurator.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb index 0bb3c62..0d5aa37 100644 --- a/lib/mongrel/configurator.rb +++ b/lib/mongrel/configurator.rb @@ -59,18 +59,18 @@ module Mongrel target_gid = Etc.getgrnam(group).gid if group if uid != target_uid or gid != target_gid - log(:info, "Initiating groups for #{user.inspect}:#{group.inspect}.") + Mongrel.log(:info, "Initiating groups for #{user.inspect}:#{group.inspect}.") Process.initgroups(user, target_gid) - log(:info, "Changing group to #{group.inspect}.") + Mongrel.log(:info, "Changing group to #{group.inspect}.") Process::GID.change_privilege(target_gid) - log(:info, "Changing user to #{user.inspect}." ) + Mongrel.log(:info, "Changing user to #{user.inspect}." ) Process::UID.change_privilege(target_uid) end rescue Errno::EPERM => e - log(:critical, "Couldn't change user and group to #{user.inspect}:#{group.inspect}: #{e.to_s}.") - log(:critical, "Mongrel failed to start.") + Mongrel.log(:critical, "Couldn't change user and group to #{user.inspect}:#{group.inspect}: #{e.to_s}.") + Mongrel.log(:critical, "Mongrel failed to start.") exit 1 end end @@ -82,7 +82,7 @@ module Mongrel # Writes the PID file if we're not on Windows. def write_pid_file unless RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw/ - log(:info, "Writing PID file to #{@pid_file}") + Mongrel.log(:info, "Writing PID file to #{@pid_file}") open(@pid_file,"w") {|f| f.write(Process.pid) } open(@pid_file,"w") do |f| f.write(Process.pid) @@ -192,7 +192,7 @@ module Mongrel if logfile[0].chr != "/" logfile = File.join(ops[:cwd],logfile) if not File.exist?(File.dirname(logfile)) - log(:critical, "!!! Log file directory not found at full path #{File.dirname(logfile)}. Update your configuration to use a full path.") + Mongrel.log(:critical, "!!! Log file directory not found at full path #{File.dirname(logfile)}. Update your configuration to use a full path.") exit 1 end end @@ -203,7 +203,7 @@ module Mongrel Dir.chdir(ops[:cwd]) else - log(:warning, "WARNING: Win32 does not support daemon mode.") + Mongrel.log(:warning, "WARNING: Win32 does not support daemon mode.") end end @@ -249,7 +249,7 @@ module Mongrel mime = load_yaml(file, mime) # check all the mime types to make sure they are the right format - mime.each {|k,v| log(:warning, "WARNING: MIME type #{k} must start with '.'") if k.index(".") != 0 } + mime.each {|k,v| Mongrel.log(:warning, "WARNING: MIME type #{k} must start with '.'") if k.index(".") != 0 } return mime end @@ -361,22 +361,22 @@ module Mongrel ops = resolve_defaults(options) # forced shutdown, even if previously restarted (actually just like TERM but for CTRL-C) - trap("INT") { log(:notice, "INT signal received."); stop(false) } + trap("INT") { Mongrel.log(:notice, "INT signal received."); stop(false) } # always clean up the pid file at_exit { remove_pid_file } unless RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw/ # graceful shutdown - trap("TERM") { log(:notice, "TERM signal received."); stop } + trap("TERM") { Mongrel.log(:notice, "TERM signal received."); stop } # debug mode - trap("USR1") { log(:notice, "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"); $mongrel_debug_client = !$mongrel_debug_client } + trap("USR1") { Mongrel.log(:notice, "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"); $mongrel_debug_client = !$mongrel_debug_client } # restart - trap("USR2") { log(:notice, "USR2 signal received."); stop(true) } + trap("USR2") { Mongrel.log(:notice, "USR2 signal received."); stop(true) } - log(:notice, "Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).") + Mongrel.log(:notice, "Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).") else - log(:notice, "Signals ready. INT => stop (no restart).") + Mongrel.log(:notice, "Signals ready. INT => stop (no restart).") end end |