# File lib/mongrel/configurator.rb, line 346
346:     def setup_signals(options={})
347:       ops = resolve_defaults(options)
348: 
349:       # forced shutdown, even if previously restarted (actually just like TERM but for CTRL-C)
350:       trap("INT") { log "INT signal received."; stop(false) }
351: 
352:       # clean up the pid file always
353:       at_exit { File.unlink(@pid_file) if @pid_file and File.exists?(@pid_file) }
354: 
355:       if RUBY_PLATFORM !~ /mswin/
356:         # graceful shutdown
357:         trap("TERM") { log "TERM signal received."; stop }
358:         trap("USR1") { log "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"; $mongrel_debug_client = !$mongrel_debug_client }
359:         # restart
360:         trap("USR2") { log "USR2 signal received."; stop(true) }
361: 
362:         log "Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart)."
363:       else
364:         log "Signals ready.  INT => stop (no restart)."
365:       end
366:     end