# File lib/chef_zero/server.rb, line 160
    def start(publish = true)
      publish = publish[:publish] if publish.is_a?(Hash) # Legacy API

      if publish
        output = publish.respond_to?(:puts) ? publish : STDOUT
        output.puts ">> Starting Chef Zero (v\#{ChefZero::VERSION})...\n".gsub(/^ {10}/, '')
      end

      thread = start_background

      if publish
        output = publish.respond_to?(:puts) ? publish : STDOUT
        output.puts ">> WEBrick (v\#{WEBrick::VERSION}) on Rack (v\#{Rack.release}) is listening at \#{url}\n>> Press CTRL+C to stop\n\n".gsub(/^ {10}/, '')
      end

      %w[INT TERM].each do |signal|
        Signal.trap(signal) do
          puts "\n>> Stopping Chef Zero..."
          @server.shutdown
        end
      end

      # Move the background process to the main thread
      thread.join
    end