<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
 == 0.8.0 Dodgy Dentist release
+ * Allow disabling signal handling in Server with :signals =&gt; false
  * Make Server.new arguments more flexible, can now specify any of host, port, app or hash options.
  * Add --backend option to specified which backend to use, closes #55
  * Serve static file only on GET and HEAD requests in Rails adapter, fixes #58</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -14,14 +14,13 @@ module Thin
   # as the first argument. Eg.: /tmp/thin.sock. If the first argument contains a &lt;tt&gt;/&lt;/tt&gt;
   # it will be assumed to be a UNIX socket. 
   #
-  #   Thin::Server.start('/tmp/thin.sock', nil, app)
+  #   Thin::Server.start('/tmp/thin.sock', app)
   #
   # == Using a custom backend
   # You can implement your own way to connect the server to its client by creating your
-  # own Backend class and pass it as the first argument.
+  # own Backend class and pass it as the :backend option.
   #
-  #   backend = Thin::Backends::MyFancyBackend.new('galaxy://faraway:1345')
-  #   Thin::Server.start(backend, nil, app)
+  #   Thin::Server.start('galaxy://faraway', 1345, app, :backend =&gt; Thin::Backends::MyFancyBackend)
   #
   # == Rack application (+app+)
   # All requests will be processed through +app+ that must be a valid Rack adapter.
@@ -44,7 +43,8 @@ module Thin
   # == Controlling with signals
   # * QUIT: Gracefull shutdown (see Server#stop)
   # * INT and TERM: Force shutdown (see Server#stop!)
-  #
+  # Disable signals by passing &lt;tt&gt;:signals =&gt; false&lt;/tt&gt;
+  # 
   class Server
     include Logging
     include Daemonizable
@@ -115,6 +115,8 @@ module Thin
       
       # If in debug mode, wrap in logger adapter
       @app = Rack::CommonLogger.new(@app) if Logging.debug?
+      
+      setup_signals unless options[:signals].class == FalseClass
     end
     
     # Lil' shortcut to turn this:
@@ -130,14 +132,9 @@ module Thin
     end
         
     # Start the server and listen for connections.
-    # Also register signals:
-    # * INT calls +stop+ to shutdown gracefully.
-    # * TERM calls &lt;tt&gt;stop!&lt;/tt&gt; to force shutdown.
     def start
       raise ArgumentError, 'app required' unless @app
       
-      setup_signals
-      
       log   &quot;&gt;&gt; Thin web server (v#{VERSION::STRING} codename #{VERSION::CODENAME})&quot;
       debug &quot;&gt;&gt; Debugging ON&quot;
       trace &quot;&gt;&gt; Tracing ON&quot;
@@ -198,7 +195,10 @@ module Thin
       @backend.running?
     end
     
-    protected            
+    protected
+      # Register signals:
+      # * INT calls +stop+ to shutdown gracefully.
+      # * TERM calls &lt;tt&gt;stop!&lt;/tt&gt; to force shutdown.    
       def setup_signals
         trap('QUIT') { stop }  unless Thin.win?
         trap('INT')  { stop! }</diff>
      <filename>lib/thin/server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -79,5 +79,10 @@ describe Server, &quot;initialization&quot; do
     server.host.should_not be_nil
     server.app.should == app
     server.backend.should be_kind_of(Thin::Backends::SwiftiplyClient)
-  end  
+  end
+  
+  it &quot;should not register signals w/ :signals =&gt; false&quot; do
+    Server.should_not_receive(:setup_signals)
+    Server.new(:signals =&gt; false)
+  end
 end
\ No newline at end of file</diff>
      <filename>spec/server_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>01dece1c2b32d9b12d1d2ee64aa78917f2ddaae1</id>
    </parent>
  </parents>
  <author>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </author>
  <url>http://github.com/macournoyer/thin/commit/6cb32ec3f90457e96cdc541a387bf50e07a6ecad</url>
  <id>6cb32ec3f90457e96cdc541a387bf50e07a6ecad</id>
  <committed-date>2008-04-03T21:03:06-07:00</committed-date>
  <authored-date>2008-04-03T21:03:06-07:00</authored-date>
  <message>Allow disabling signal handling in Server with :signals =&gt; false</message>
  <tree>f00a5f8771386f5b8619b3c6aaec75bda48f2f77</tree>
  <committer>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </committer>
</commit>
