def run
      # Exit if not configured correctly
      unless configured?
        puts parser
        exit
      end

      # Boot and add project's lib/ dir to load path
      require 'fluq'
      $LOAD_PATH.unshift FluQ.root.join('lib')
      procline "(starting)"

      # Setup logger
      if options[:log]
        FileUtils.mkdir_p(File.dirname(options[:log]))
        FluQ.logger = ::Logger.new(options[:log])
      end
      if options[:verbose]
        FluQ.logger.level = ::Logger::DEBUG
      end

      # Write PID file
      @pidfile = options[:pidfile] || FluQ.root.join("tmp", "pids", "fluq.pid")
      FileUtils.mkdir_p(File.dirname(@pidfile))
      File.open(@pidfile, "w") {|f| f.write Process.pid }

      # Trap signals
      SIGNALS.each do |signal|
        trap(signal) {|*| shutdown! }
      end

      # Start
      log "Starting FluQ #{FluQ::VERSION} (#{options[:config]})"
      FluQ::Runner.run do |runner|
        FluQ::DSL::Root.new(options[:config]).apply(runner)
        procline
      end
    end
def run
      # Exit if not configured correctly
      unless configured?
        puts parser
        exit
      end

      # Boot and add project's lib/ dir to load path
      require 'fluq'
      $LOAD_PATH.unshift FluQ.root.join('lib')
      procline "(starting)"

      # Setup logger
      if options[:log]
        FileUtils.mkdir_p(File.dirname(options[:log]))
        FluQ.logger = ::Logger.new(options[:log])
      end
      if options[:verbose]
        FluQ.logger.level = ::Logger::DEBUG
      end

      # Write PID file
      @pidfile = options[:pidfile] || FluQ.root.join("tmp", "pids", "fluq.pid")
      FileUtils.mkdir_p(File.dirname(@pidfile))
      File.open(@pidfile, "w") {|f| f.write Process.pid }

      # Trap signals
      SIGNALS.each do |signal|
        trap(signal) {|*| shutdown! }
      end

      # Start
      log "Starting FluQ #{FluQ::VERSION} (#{options[:config]})"
      FluQ::Runner.run do |runner|
        FluQ::DSL::Root.new(options[:config]).apply(runner)
        procline
      end
    end
Constructor