# File lib/raemon/master.rb, line 57
    def stop(graceful=true)
      kill_each_worker(graceful ? :QUIT : :TERM)
      timeleft = timeout
      step = 0.2

      reap_all_workers

      until WORKERS.empty?
        sleep(step)
        reap_all_workers
        (timeleft -= step) > 0 and next
        kill_each_worker(:KILL)
      end

      Configuration.on_stop.call

      instrument 'master.stop', :pid => master_pid
    end